Select statement return different row result when include/exclude a certain column.
Select statement return different row result when include/exclude a certain column. it may have something to do with our dataset and actual query. we would like to have this looked at and is willing to give you access to the real database i.e. below query doesn't return the same amount of rows. (query run in both vsql and jdbc driver, both have problems.) select table1.a, table2.b, table3.c from table1 left join table2 left join table3 left join table4 where {condtions} select table1.a, -- table2.b, table3.c from table1 left join table2 left join table3 left join table4 where {conditions}
0
Comments
t1.id > t2.id and t2.id > t3.id
or could be "start dependency" (t3.id <-- t1.id --> t2.id):t1.id > t2.id and t1.id < t3.id
or even trivial condition:table2.b != 0
and of cause result can be different. Result have to be same only in case that condition is "equivalence relation"(http://en.wikipedia.org/wiki/Equivalence_relation) otherwise it is not promised.SELECT a b FROM t WHERE b < 10;
andSELECT * FROM t WHERE b < 10;
(The former query was missing a comma between "a" and "b", so didn't mean what its author thought that it meant. The original queries were of course more complicated, so this was hard to spot.) Adam