Re: [GENERAL] query from two tables & concat the result

2016-02-04 Thread arnaud gaboury
On Wed, Feb 3, 2016 at 8:19 PM, Raymond O'Donnell wrote: > On 03/02/2016 14:05, arnaud gaboury wrote: thetradinghall=> SELECT u.username ||'@'||d.domain as email_address FROM email.mailusers u INNER JOIN email.domainlist d ON (u.domain_id=d.id);

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread Raymond O'Donnell
On 03/02/2016 14:05, arnaud gaboury wrote: >>> >>> 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

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
>> >> 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.gabo...@thetradinghall.com >> (1 row) >>

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread Raymond O'Donnell
On 03/02/2016 13:57, arnaud gaboury wrote: > On Wed, Feb 3, 2016 at 2:19 PM, Raymond O'Donnell wrote: >> On 03/02/2016 13:11, arnaud gaboury wrote: >> >>> Hum hum... >>> -- >>> SELECT u.username ||'@'||d.domain as email_address >>> FROM email.mai

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
On Wed, Feb 3, 2016 at 1:55 PM, Ricardo Ramírez wrote: > For resetting the id you may want to take a look at the sequence > manipulation functions [1] Problem has been solved by removing the id column. > > Regards, > Ricardo > > [1]http://www.postgresql.org/docs/current/static/functions-sequenc

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
On Wed, Feb 3, 2016 at 2:19 PM, Raymond O'Donnell wrote: > On 03/02/2016 13:11, arnaud gaboury wrote: > >> Hum hum... >> -- >> SELECT u.username ||'@'||d.domain as email_address >> FROM email.mailusers u >> INNER JOIN >> email.domain d >> ON >> (

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread Raymond O'Donnell
On 03/02/2016 13:11, arnaud gaboury wrote: > Hum hum... > -- > SELECT u.username ||'@'||d.domain as email_address > FROM email.mailusers u > INNER JOIN > email.domain d > ON > (u.domain_id=d.domain.id) > WHERE id=1; > > ERROR: missing FROM-clau

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
On Wed, Feb 3, 2016 at 1:51 PM, Raymond O'Donnell wrote: > On 03/02/2016 12:18, arnaud gaboury wrote: >> $ psql -V >> psql (PostgreSQL) 9.4.5 >> >> I am quite a newbie in psql. I am setting an email server and need to >> create then query psql tables to get some information: mainly email >> addres

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread Ricardo Ramírez
For resetting the id you may want to take a look at the sequence manipulation functions [1] Regards, Ricardo [1]http://www.postgresql.org/docs/current/static/functions-sequence.html On Wed, Feb 3, 2016, 06:26 arnaud gaboury wrote: > On Wed, Feb 3, 2016 at 1:18 PM, arnaud gaboury > wrote: > >

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread Raymond O'Donnell
On 03/02/2016 12:18, arnaud gaboury wrote: > $ psql -V > psql (PostgreSQL) 9.4.5 > > I am quite a newbie in psql. I am setting an email server and need to > create then query psql tables to get some information: mainly email > address and mail directory. > > For now I have created two tables this

Re: [GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
On Wed, Feb 3, 2016 at 1:18 PM, arnaud gaboury wrote: > $ psql -V > psql (PostgreSQL) 9.4.5 > > I am quite a newbie in psql. I am setting an email server and need to > create then query psql tables to get some information: mainly email > address and mail directory. > > For now I have created two t

[GENERAL] query from two tables & concat the result

2016-02-03 Thread arnaud gaboury
$ psql -V psql (PostgreSQL) 9.4.5 I am quite a newbie in psql. I am setting an email server and need to create then query psql tables to get some information: mainly email address and mail directory. For now I have created two tables this way. Both tables are in same database and schema. I only i