Re: conditional FROM - Mailing list pgsql-sql

From Andreas Kretschmer
Subject Re: conditional FROM
Date
Msg-id 20111210173029.GA21557@tux
Whole thread Raw
In response to Re: conditional FROM  (Richard Klingler <richard@klingler.net>)
List pgsql-sql
Richard Klingler <richard@klingler.net> wrote:

> This seems to do the trick...
> 
> select arp.ip, arp.mac, arp.port2time, arp.time, arp.hostname, arp.vlan 
> from arp, port, node
> where
>     arp.arp2port = port.portid and port.name = 'Fa1/0/1'
>     and port.port2node = node.nodeid
>     and node.name like 'nodename%'
> union
> select arp.ip, arp.mac, arp.port2time, arp.time, arp.hostname, arp.vlan 
> from arp, port, card, node
> where
>     arp.arp2port = port.portid and port.name = 'Fa1/0/1'
>     and port.port2card = card.cardid
>     and card.card2node = node.nodeid
>     and node.name like 'nodename%'
> ;
> 
> Though I just can't order the rows anymore by inet(arp.ip) anymore...
> Any hints on my ordering isn't anylonger possible?

select * from (insert the query above here) foo order by ...

Regards...

Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


pgsql-sql by date:

Previous
From: Richard Klingler
Date:
Subject: Re: conditional FROM
Next
From: Bèrto ëd Sèra
Date:
Subject: Re: conditional FROM