strange query problem
I have a table where salary is a field with integer type.
I have values like
Now my query is like
select * from job_list where type='Temporary' or type='Contract' and salary>='10000' and salary<='30000' order by salary desc
Ihave tried this above query with BETWEEN too but still fetching 1 row where it should fetch 0 row
Please suggest as I am really astonished.
Try it like this so as to not pick up all the Temporary rows
select * from job_list where (type='Temporary' or type='Contract') and salary>='10000' and salary<='30000' order by salary desc
The AND takes priority over the OR and so your original will return values when either of the following is met:
2 type='Contract' and salary>='10000' and salary<='30000'
Last edited by felgall; 01-11-2007 at 01:48 PM.
Great.......yes you are correct....the and is getting over or
Its working now......Thanks a lot.....Luv...Raj
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)