sql - Using Count and OR giving too high a value -


hi have query want return 1 value. if run query in 2 parts , add them fine when try , or operator value increases.

here first query:

    select count (*) tablename date_tre='2013-10-06' , sector= '1' 

this returns 3867

here second:

 select count (*) tablename date_tre='2013-10-06' , sector= '01' 

this returns 9

when run using or

 select count (*) tablename date_tre='2013-10-06' , sector= '1' or sector = '01' 

i value of 4066, ideas im wanting figure of 3876

i think because evaluates this

select count (*)  tablename  (date_tre='2013-10-06' , sector= '1') or sector = '01' 

when looking this(try one)

select count (*)  tablename  date_tre='2013-10-06' , (sector= '1' or sector = '01') 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -