>>>>> "RAA" == Roderick A Anderson <raanders@altoplanos.net> writes:
RAA> I know I've seen this but can't even begin to guess where that was so I'll
RAA> ask. I need to add a fake entry to a UNION. A row that doesn't exist in
RAA> the table and shouldn't. It's for a CGI script where I want the user have
RAA> the all/none/whatever option.
RAA> select tbl_key, equipname from equipment
RAA> UNION
RAA> select 'All', 'All Equipment' from ???
RAA> Heck I can't even remember what is was called in Oracle.
I guess answer is (assume tbl_key is varchar(20), and equipname is text type):
select tbl_key, equipname from equipment
UNION
select 'All'::varchar as tbl_key , 'All Equipment'::text as equipname;
You don't need 'from' clause in PostgreSQL in this case.
--
Anatoly K. Lasareff Email: tolik@aaanet.ru