On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote:

> I'm interested in finding the minimim A.id such that the following holds:
> 
> select A.charge
>     , B.user_id
>     , C.employee_id
> from A
> inner join B using (user_id)
> inner join C using (employee_id)
> 
> except
> 
> select X.charge
>     , Y.user_id
>     , Z.employee_id
> from X
> inner join Y using (user_id)
> inner join Z using (employee_id)
> 
> --
> 
> I can't do the following, since the number of selected columns have to match: 
> 
> select A.id 
>     , A.charge
>     , B.user_id
>     , C.employee_id
> from A
> inner join B using (user_id)
> inner join C using (employee_id)
> 
> except
> 
> select X.charge
>     , Y.user_id
>     , Z.employee_id
> from X
> inner join Y using (user_id)
> inner join Z using (employee_id)

Maybe you can add a dummy field in the second half like this:

except

 select -1 
     , X.charge
     , Y.user_id
     , Z.employee_id

???


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to