Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases and the fly likes order of condition is important Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "order of condition is important" Watch "order of condition is important" New topic
Author

order of condition is important

Guddu Ali
Ranch Hand

Joined: Jul 18, 2012
Posts: 34
SELECT EMP.EMPNAME,EMP.EMPID,
EMP.EMPDEPID,DEPT.DEPTID
FROM EMPLOYEE EMP,DEPARTMENT DEPT
WHERE EMP.EMPDEPID=DEPT.DEPTID;

Here in where clause is the order of condtion ie
EMP.EMPDEPID=DEPT.DEPTID
or
DEPT.DEPTID = EMP.EMPDEPID
Is important ?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32614
    
215

No. The database will optimize your query the same way regardless of which order you type those in.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
Don't get me started about those stupid light bulbs.
 
subject: order of condition is important
 
It's not a secret anymore!