Re: [SQL] Substract queries

2008-05-22 Thread Ramasubramanian G
LABIDI Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Substract queries Nacef LABIDI wrote: > Hi all, > > I was wondering how can I substract result between select queries. I mean I > want to issue a query that does this : > (select * from mytable where condition1) - (select * fro

Re: [SQL] Substract queries

2008-05-22 Thread Niklas Johansson
On 22 maj 2008, at 17.15, Nacef LABIDI wrote: I was wondering how can I substract result between select queries. I mean I want to issue a query that does this : (select * from mytable where condition1) - (select * from mytable where condition2) If you (as implied above) query the same table

Re: [SQL] Substract queries

2008-05-22 Thread Nacef LABIDI
Thanks to all the EXEPT keyword is what I was looking for On Thu, May 22, 2008 at 5:36 PM, Niklas Johansson <[EMAIL PROTECTED]> wrote: > > On 22 maj 2008, at 17.15, Nacef LABIDI wrote: > >> I was wondering how can I substract result between select queries. I mean >> I want to issue a query that d

Re: [SQL] Substract queries

2008-05-22 Thread Craig Ringer
Nacef LABIDI wrote: Hi all, I was wondering how can I substract result between select queries. I mean I want to issue a query that does this : (select * from mytable where condition1) - (select * from mytable where condition2) If the subqueries return single (scalar) results, you can just subt

Re: [SQL] Substract queries

2008-05-22 Thread Robins Tharakan
u, May 22, 2008 at 8:45 PM Subject: [SQL] Substract queries To: pgsql-sql@postgresql.org Hi all, I was wondering how can I substract result between select queries. I mean I want to issue a query that does this : (select * from mytable where condition1) - (select * from mytable where condition2)

[SQL] Substract queries

2008-05-22 Thread Nacef LABIDI
Hi all, I was wondering how can I substract result between select queries. I mean I want to issue a query that does this : (select * from mytable where condition1) - (select * from mytable where condition2) Thanks to all Nacef