From: | Jan Poslusny <pajout(at)gingerall(dot)cz> |
---|---|
To: | Anton(dot)Nikiforov(at)loteco(dot)ru |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Select statment question |
Date: | 2004-02-17 20:40:28 |
Message-ID: | 40327C3C.3050506@gingerall.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
select dt1.text as name, dt2.text as description
from dictionary_text dt1, dictionary_optiongroup do, dictionary_text dt2
where dt1.label = do.name and do.description = dt2.label;
not tested :)
Anton Nikiforov wrote:
> Dear All,
> could you please help me with writing select statment for the following:
> I have two tables
> dictionary_text
> label| Text
> -----+------------------------
> 23 | General
> 24 | Internet
> 25 | General option group
> 26 | Internet option group
>
> And
> dictionary_optiongroup
> id | name | description
> ----+------+-------------
> 0 | 23 | 25
> 1 | 24 | 26
>
> How should i write SELECT statement to get the following:
> name | description
> ---------+----------------------
> General | General option group
> Internet | Internet option group
>
> I understand that maybe this question is not for this list, but my
> brains stuck with this select. Could you please help.
>
> Best regards,
> Anton
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
From | Date | Subject | |
---|---|---|---|
Next Message | Oleg Lebedev | 2004-02-17 20:42:21 | Re: Select statment question |
Previous Message | Mike Nolan | 2004-02-17 20:16:39 | Re: how to merge a table from another DB |