Re: [gnome-db] GdaSqlBuiler: JOIN AS

Alexey Zakhlestin <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
On 17.05.2010, at 16:53, Murray Cumming wrote:

> Here's a silly example that shows the need for the name, because using
> the table name would be ambiguous:
> 
> SELECT "albums"."album_id", "albums"."name",
> "albums"."artist_singer_id", "relationship_artist_singer"."name",
> "albums"."artist_drummer_id", "relationship_artist_drummer"."name",
>  FROM "albums"
>  LEFT JOIN "artists"
>    AS "relationship_artist_singer"
>    ON ("albums"."artist_singer_id" =
> "relationship_artist_singer"."artist_id")
>  LEFT JOIN "artists"
>    AS "relationship_artist_drummer"
>    ON ("albums"."artist_drummer_id" =
> "relationship_artist_drummer"."artist_id")
> WHERE "albums"."album_id" = 123

Vivien says, that you are setting alias not for join, but for table, which is joined.
Better illustrated by different formatting:

FROM
    "albums"
LEFT JOIN
    "artists" AS "relationship_artist_singer"
    ON ("albums"."artist_singer_id" = "relationship_artist_singer"."artist_id")
LEFT JOIN
    "artists" AS "relationship_artist_drummer"
    ON ("albums"."artist_drummer_id" = "relationship_artist_drummer"."artist_id")

_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list
smime.p7s (application/pkcs7-signature, 2.6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.