Re: [gnome-db] GdaSqlBuiler: JOIN AS
- From: Vivien Malerba <vmalerba gmail com>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gnome-db-list <gnome-db-list gnome org>
- Subject: Re: [gnome-db] GdaSqlBuiler: JOIN AS
- Date: Mon, 17 May 2010 14:20:40 +0200
On 17 May 2010 10:07, Murray Cumming <murrayc murrayc com> wrote:
> In Glom, I use the AS keyword with JOINS, to allow multiple joins with
> the same table. A simple case looks like this, though it's unnecessary
> in this particular example:
>
> SELECT "albums"."album_id", "albums"."name", "albums"."artist_id",
> "relationship_artist"."name",
> FROM "albums"
> LEFT JOIN "artists"
> AS "relationship_artist"
> ON ("albums"."artist_id" = "relationship_artist"."artist_id")
> WHERE "albums"."album_id" = 123
>
> (That might be an "alias", but I don't know if that's the right
> terminology.)
>
> But I don't see how to do that with
> gda_sql_builder_select_join_targets()
> http://library.gnome.org/devel/libgda/unstable/GdaSqlBuilder.html#gda-sql-builder-select-join-targets
>
To do this you need to specify an alias when using the
gda_sql_builder_select_add_target*() methods.
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]