Re: query from two tables & concat the result

From: arnaud gaboury <arnaud(dot)gaboury(at)gmail(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: query from two tables & concat the result
Date: 2016-02-03 14:05:48
Message-ID: CAK1hC9v_W=CsUC3wFNkQiceGvjN5Cm5pmBgUxyonUhd8osU3WA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>
>> thetradinghall=> SELECT u.username ||'@'||d.domain as email_address
>> FROM email.mailusers u
>> INNER JOIN
>> email.domainlist d
>> ON
>> (u.domain_id=d.id);
>>
>> email_address
>> -----------------------------------
>> arnaud(dot)gaboury(at)thetradinghall(dot)com
>> (1 row)
>> -------------------------------------
>>
>> As for the cleaning of ID, I dropped id and changed both primary keys.
>> Thank you so much for your prompt answer and help.

In fact I kept the id for table domainlist (changed the name
accordingly your advise). If I remove the id column, I will not be
able anymore to do the above SELECT , no?
The condition (u.domain_id=d.id) will no more be possible.

Am I wrong?

>
> You're very welcome - glad to be able to help.
>
> R.
>
>
> --
> Raymond O'Donnell :: Galway :: Ireland
> rod(at)iol(dot)ie

--

google.com/+arnaudgabourygabx

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2016-02-03 17:25:30 Re: Postgres 9.5 - password for new windows user
Previous Message Raymond O'Donnell 2016-02-03 14:01:17 Re: query from two tables & concat the result