Home » SQL & PL/SQL » SQL & PL/SQL » where clauses parse order (10g)
where clauses parse order [message #427901] Mon, 26 October 2009 06:09 Go to next message
abhi_shakya
Messages: 50
Registered: September 2009
Location: Nepal
Member
select * from employees
where employee_id='122'
and job_id=123;

this query when executed returns error at job_id=123 due to data type mismatch...but employee_id also doesn't match...

but why it checks from the last one..
Re: where clauses parse order [message #427903 is a reply to message #427901] Mon, 26 October 2009 06:11 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
You cannot tell just by looking at a query what the order will be in which the predicates will be applied.
Re: where clauses parse order [message #427908 is a reply to message #427903] Mon, 26 October 2009 06:24 Go to previous messageGo to next message
abhi_shakya
Messages: 50
Registered: September 2009
Location: Nepal
Member
what shud i check then...
Re: where clauses parse order [message #427913 is a reply to message #427908] Mon, 26 October 2009 06:32 Go to previous messageGo to next message
Michel Cadot
Messages: 63801
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to read OraFAQ Forum Guide and post accordingly that is:
- a copy of your SQL*Plus session
- with the correct format
- with the exact error
- with Oracle version

Regards
Michel
Re: where clauses parse order [message #427914 is a reply to message #427901] Mon, 26 October 2009 06:32 Go to previous message
cookiemonster
Messages: 12320
Registered: September 2008
Location: Rainy Manchester
Senior Member
There's no point worrying about the order the predicates are applied in - oracle can change it at any time.
If you have a type mismatch error then you need to fix it.
Previous Topic: Grant select on all tables of schema [Merged]
Next Topic: shedule job is not working
Goto Forum:
  


Current Time: Sun Sep 25 02:43:06 CDT 2016

Total time taken to generate the page: 0.07887 seconds