I'm trying to understand the grouping magic and testing the first and
last query.
Only thing is for some reason, I'm not getting any result for the last
query.  Perhaps i'm doing something wrong.


Works perfectly for me, are you sure you have it exactly so? Check the table names correspond to your tables maybe. (Though the other queries should fail too if that was a problem):
Also ensure you have a Person in the PersonTable with id = 5.

SELECT T.id AS TeamID, T.name AS TeamName, P.id AS PersonID, P.name AS 
PersonName
FROM TeamPersonTable TP
LEFT JOIN PersonTable P ON P.id=TP.personId
LEFT JOIN TeamTable T ON T.id=TP.teamId
WHERE P.id=5



On 2014/05/22 14:28, Humblebee wrote:
Wow, I just tried the "Group" thing and it's truly magic.  Big Bang !
The first query gave the Exact answer I was looking for.  It even
assembled a string.

Forgot to mention: These queries and subsequent amazement is only courtesy of those tables being in 1NF format now, it is what makes the queries possible to be linked up in the way (or in any other way you might dream up) - which is why other posters tried to urge you so hard to consider changing to this. Very glad you did.

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

Reply via email to