select multiple immediate values, but in multiple rows - Mailing list pgsql-sql

From Luca Pireddu
Subject select multiple immediate values, but in multiple rows
Date
Msg-id 200503142318.27510.lucap@shaw.ca
Whole thread Raw
Responses Re: select multiple immediate values, but in multiple rows
Re: select multiple immediate values, but in multiple rows
List pgsql-sql
Hello all.  I'd like to write a query does a set subtraction A - B, but A is 
is a set of constants that I need to provide in the query as immediate 
values.  I thought of something like

select a from (1,2,3.4)
except
select col_name from table;

but I don't know the syntax to specify my set of constants.  I thought of 
doingselect 1 union select 2 union select 3 union ... except ...
but I figure there must be a better way.  The size of the set would be 
anywhere between 1 and about 5 or 6 elements.  Is there a better way to do 
this?

Thanks.

Luca  


pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: postgresql 8.01, plpgsql
Next
From: Richard Huxton
Date:
Subject: Re: Inserting values in arrays