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
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
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
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
Probably you are looking for EXCEPT.
SELECT * FROM Tbl1 WHERE a=1
EXCEPT
SELECT * FROM tbl2 WHERE a=1 and b=1;
http://www.postgresql.org/docs/8.3/interactive/sql-select.html
Regards,
*Robins Tharakan*
-- Forwarded message --
From: Nacef LABIDI <[EMAIL PROTECTED]>
Date: Thu, May