> > essence of problem: > > why is there a difference in output between the following selects? > > sqlite> select * from t1 where (select count(*) from t2 where > t2.id=t1.id) = '2'; > sqlite> select * from t1 where cast((select count(*) from t2 where > t2.id=t1.id) > as integer)= '2'; > 2 >
Because string '2' is not the same thing as integer 2. sqlite3> select 2='2'; 0 sqlite3> D. Richard Hipp d...@hwaci.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users