On Mon, Oct 25, 2010 at 1:18 PM, Alexey Pechnikov <[email protected]>wrote:

>
> CREATE VIEW view_user AS
> SELECT user.id,user_record.*
> FROM user, user_record
> WHERE user.id=user_record.user_id
> GROUP BY user.id
> ORDER BY name ASC;
>

The result of the view above is undefined.  It will choose one of the
user_record rows for each distinct user.id, but you don't know which row.
Your queries below return different results depending on which of the
user_record rows is choosen.  3.7.2 just happened to choose a different
result row from 3.7.3.  But that is not a bug.



>
> -- returns two rows
> select * from main.view_user where record_id in (select record_id from
> main.view_user where name like '%');
> -- but count(*) returns 1
> select count(*) from main.view_user where record_id in (select record_id
> from main.view_user where name like '%');
> -- equal query returns only single row!
> select * from main.view_user where record_id in (select record_id from
> main.view_user where name like '%') order by name;
>
> ---------------------------------------
>
> --
> Best regards, Alexey Pechnikov.
> http://pechnikov.tel/
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to