Dear all,

Following select query returns different result data between v3.7.11 and
v3.7.13~.

CREATE TABLE foods(
  id integer primary key,
  type_id integer,
  name text );
CREATE TABLE foods_episodes(
  food_id integer,
  episode_id integer );

[Insert some data]

SELECT
  name,
  (SELECT COUNT(id) FROM foods_episodes WHERE food_id=f.id) count
FROM
  foods f
ORDER BY count DESC LIMIT 10;


Result from v3.7.6 and v3.7.11.

Hot Dog|5
Kasha|4
Ketchup|4
......


Result from v3.7.13 and v3.7.17.

Wax Beans (Generic brand)|412


Which result set is correct?
When I changed statement from COUNT(id) to COUNT(food_id) or COUNT(*), it
shows same result with older version.

I've got this examples from following links of "The Definitive Guide to
SQLite"

http://www.apress.com/9781430232254

Regards,
Yongil.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to