Re: conditional FROM

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: conditional FROM
Дата
Msg-id 20111210173029.GA21557@tux
обсуждение исходный текст
Ответ на Re: conditional FROM  (Richard Klingler <richard@klingler.net>)
Список 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 по дате отправления:

Предыдущее
От: Richard Klingler
Дата:
Сообщение: Re: conditional FROM
Следующее
От: Bèrto ëd Sèra
Дата:
Сообщение: Re: conditional FROM