[postgis-users] Except

Matt Doughty matt.doughty at geograma.com
Wed Nov 28 09:29:07 PST 2007


Hi,

I've managed to solve the problem by means of a function (see attached).

Matt

 
 
Matt Doughty
 
GEOGRAMA S.L.
Tel.:  +34 945 13 13 72    652 77 14 15
Fax: +34 945 23 03 40 
www.geograma.com
 
 

-----Mensaje original-----
De: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] En nombre de Kevin Neufeld
Enviado el: miércoles, 28 de noviembre de 2007 17:04
Para: PostGIS Users Discussion
Asunto: Re: [postgis-users] Except

Sorry, my bad... I misread your question. 

You might be able to write a plpgsql function that went looking at the 
system tables for a list of all your columns for a given table and then 
build a query using the columns of your choice.
-- Kevin

Kevin Neufeld wrote:
> How about,
>
> SELECT col1, col2, col3 FROM my_tbl
> EXCEPT
> (SELECT col1, col2, col3 FROM my_tbl LIMIT 1);
>
> -- Kevin
>
> Matt Doughty wrote:
>>
>> Hi,
>>
>> Is there a way of selecting all fields except one in particular? I'd 
>> like to create a query that says something like: select * except 
>> field01. The thing is the query needs to be valid for a number of 
>> different tables, each with a different set of fields apart from one 
>> (gid), which I don't want to select.
>>
>> Cheers,
>>
>> Matt
>>
>> Matt Doughty
>>
>>     
>>
>> GEOGRAMA S.L.
>>
>> Tel.: +34 945 13 13 72 652 77 14 15
>>
>> Fax: +34 945 23 03 40
>>
>> www.geograma.com
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>   
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Funcion 'getfields_not'.sql
Type: application/octet-stream
Size: 901 bytes
Desc: Funcion 'getfields_not'.sql
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071128/4397b1b3/attachment.obj>


More information about the postgis-users mailing list