pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-sql@postgresql.org
Subject: Re: conditional FROM
Date: Sat, 10 Dec 2011 18:30:29 +0100
Message-ID: <20111210173029.GA21557@tux> (raw)
In-Reply-To: <20111210182242043383.dc56d2c5@klingler.net>
References: <20111210170332479879.3df30525@klingler.net>
	<2BBB44CA-7EFA-4084-906F-6CB72AD28C6E@yahoo.com>
	<20111210182242043383.dc56d2c5@klingler.net>

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°



view thread (7+ messages)  latest in thread

Message-ID: <20111210173029.GA21557@tux>
Permalink:  ../20111210173029.GA21557@tux/
Also on:    postgresql.org/message-id/20111210173029.GA21557@tux

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: akretschmer@spamfence.net
  Subject: Re: conditional FROM
  In-Reply-To: <20111210173029.GA21557@tux>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox