Re: How to use nested select statements - Mailing list pgsql-hackers

From Don Baccus
Subject Re: How to use nested select statements
Date
Msg-id 3.0.1.32.20001129074326.0179ecb0@mail.pacifier.com
Whole thread Raw
In response to How to use nested select statements  (Sanjay Arora <sk@pobox.com>)
List pgsql-hackers
At 08:31 PM 11/29/00 +0530, Sanjay Arora wrote:

>Well I want to use nested select statements ,is it possible.

In PG 7.0 you can use subselects in the "where" clause.

>Is there any counterpart for 'Sysdate from dual' as in Oracle

You don't need "dual", just "select now()" will work.

If you're porting Oracle code, you can make life a lot easier by
defining some stuff:

create function sysdate() returns datetime as '
begin  return ''now'';
end;' language 'plpgsql';

create view dual as select sysdate();

Then "select sysdate from dual", "select (any expression) from dual", etc all do what
you'd expect.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Sanjay Arora
Date:
Subject: How to use nested select statements
Next
From: Tom Lane
Date:
Subject: Re: F_SETLK is looking worse and worse...