Hi all,
I found fmdatabase get different result from sql command below:
first set:
SELECT * FROM Table1 WHERE Col1=29 AND Col2 IN (308, 4073) AND Col3=0 AND Col4<>-9223372036854775808 ORDER BY Col5 DESC, Col6 DESC
SELECT * FROM Table1 WHERE Col1=29 AND (Col2=308 OR Col2=4073) AND Col3=0 AND Col4<>-9223372036854775808 ORDER BY Col5 DESC, Col6 DESC
second set:
SELECT * FROM Table1 WHERE Col1=29 AND Col2 IN (4073, 308) AND
Col3=0 AND Col4<>-9223372036854775808 ORDER BY Col5 DESC, Col6
DESC
SELECT * FROM Table1 WHERE Col1=29 AND (Col2=4073 OR Col2=308) AND
Col3=0 AND Col4<>-9223372036854775808 ORDER BY Col5 DESC, Col6
DESC
There is only Col2 order different.
But when Col2=308 first, the result will be Col2=308, without 4073.
In the other hand, when Col2=4073 first, the result will be Col2=4073 and without 308.
Does somebody have the same problem? How to resolve it?