Sorry for the subject, but I knew no words to describe it better.
I will try to explain
First a more general question: is there any clever way to do two
selects A and B and then return the result
A union ( B \ (A intersect B)) ( \ is "set subtraction")
Any ideas besides writing the explicit queries? I guess one has to
lock the table to get the same result on both selects unless one can
cache the result of A and B so you don't run it twice?
Then the actual problem at hand, which with extra details might result
in another solution then the one from above.
A looks like select a.id,a.name,true from X
B looks like select b.id,b.name,false from Y
can one then use the differences in boolean values in some clever way,
like OR operation?
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2010-11-04 20:43:41|
|Subject: Re: How to do A union (B - ( A intersect B )) or sort of :-) |
|Previous:||From: Thomas Kellerer||Date: 2010-11-04 16:53:59|
|Subject: Re: Function to spell out a number|