Lets say I have the following tables:
movies: id,title
user:     id,rating
tag:       id,tag

I want to left join all three tables:
SELECT movies.id,movies.title,user.rating,tag.tag
FROM movies natural left join user natural left join tag

The problem with this besides having to specify the tables (instead of
doing: select id,title,rating,tag) is that if a movie doesn't have any
rating it will not retrieve any tag neither. The table tag is joined to the
table user not to the main table movies

The following works as expected but it is terribly slow:
SELECT id,title,rating,tag
FROM movies natural left join (movies natural left join user) natural left
join (movies natural left join tag)

Is there any way to get the last result with an acceptable speed?
-- 
View this message in context: 
http://old.nabble.com/Multiples-natural-left-joins-problem-tp26627140p26627140.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to