Skip site navigation (1) Skip section navigation (2)


From: George McQuade <gm(at)winls(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Subquery
Date: 2005-06-21 19:37:32
Message-ID: 1119382653.2853.9.camel@sat1 (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hello List,

I have 2 identical tables, table1 and table2 with 2 fields:
id int and idname varchar(30). I am successful in retrieving the records
in table1 not in table2 with:

select id from table1 except select id from table2;

which is great. It would be even greater if I can get the table1.idname
as part of the output, for example:

id    idname
----- ------
1     rice
2     beans
3     soy

something tells me I need to make my query a subquery of something else,
but can't quite figure it out.

thanks for any pointers



  • Re: Subquery at 2005-06-21 20:34:33 from Keith Worthington

pgsql-novice by date

Next:From: SigurĂ°ur ReynissonDate: 2005-06-21 20:04:07
Subject: Newbie Q:"RETURN cannot have a parameter in function returning set"?
Previous:From: operationsengineer1Date: 2005-06-21 18:25:59
Subject: Re: pgsql error interpretation issue. solved - sort of...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group