<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [postgis-users] Except</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>this is a pure SQL question, not a postGIS one really. there is nothing like that in the SQL standard but you can come up with a generic SQL-generating code using the system tables. something along these lines (using psql as an example):<BR>
<BR>
test=# \t<BR>
Showing only tuples.<BR>
test=# \a<BR>
Output format is unaligned.<BR>
test=# \o /tmp/test.sql<BR>
test=# select<BR>
test-#   'select ' ||<BR>
test-#   array_to_string(array(<BR>
test-#     select column_name::text from information_schema.columns c<BR>
test-#     where c.table_name = t.table_name<BR>
test-#       and column_name!='employee_id'<BR>
test-#   ),', ') ||<BR>
test-#   ' from ' || table_name<BR>
test-# from information_schema.tables t<BR>
test-# where table_schema = 'test' and table_name = 'employee';<BR>
test=# \o<BR>
test=# \i /tmp/test.sql<BR>
...<BR>
<BR>
you get the idea. hope this helps.<BR>
<BR>
george<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: postgis-users-bounces@postgis.refractions.net on behalf of Matt Doughty<BR>
Sent: Wed 11/28/07 04:31 AM<BR>
To: PostGIS Users Discussion<BR>
Subject: [postgis-users] Except<BR>
<BR>
Hi,<BR>
<BR>
Is there a way of selecting all fields except one in particular? I'd<BR>
like to create a query that says something like: select * except<BR>
field01.  The thing is the query needs to be valid for a number of<BR>
different tables, each with a different set of fields apart from one<BR>
(gid), which I don't want to select.<BR>
<BR>
Cheers,<BR>
<BR>
Matt<BR>
<BR>
<BR>
<BR>
Matt Doughty<BR>
<BR>
GEOGRAMA S.L.<BR>
Tel.:  +34 945 13 13 72    652 77 14 15<BR>
Fax: +34 945 23 03 40<BR>
www.geograma.com<BR>
<BR>
</FONT>
</P>

<br/>This electronic message contains information from Multifamily Technology Solutions, Inc. (MyNewPlace.com) and is confidential or privileged.  The information is intended to be for the use of the individual or entity named above.  If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this message is prohibited.  If you have received this electronic message in error, please notify us immediately by telephone at (415) 348-2000 or electronic mail.
 </BODY>
</HTML>