Skip site navigation (1) Skip section navigation (2)

Re: How to use nested select statements

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Sanjay Arora <sk(at)pobox(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to use nested select statements
Date: 2000-11-29 15:43:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 '
   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(at)pacifier(dot)com>
  Nature photos, on-line guides, Pacific Northwest
  Rare Bird Alert Service and other goodies at

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-11-29 15:55:36
Subject: Re: F_SETLK is looking worse and worse...
Previous:From: Sanjay AroraDate: 2000-11-29 15:01:07
Subject: How to use nested select statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group