Re: extracting date from timestamp - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: extracting date from timestamp
Date
Msg-id 20050125040508.GA8202@winnie.fuhr.org
Whole thread Raw
In response to Re: extracting date from timestamp  (Alexander Borkowski <alexander.borkowski@abri.une.edu.au>)
List pgsql-novice
On Tue, Jan 25, 2005 at 11:14:20AM +1100, Alexander Borkowski wrote:
>
> You have the order for pl/pgsql SELECT INTO wrong (target variable(s)
> first, then the value(s) you want to assign)

Either order is correct:

SELECT INTO var field FROM ...
SELECT field INTO var FROM ...

See the SELECT INTO documentation:

http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-SELECT-INTO

"The INTO clause can appear almost anywhere in the SELECT statement.
Customarily it is written either just after SELECT as shown above,
or just before FROM that is, either just before or just after the
list of select_expressions."

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Removing a user's password
Next
From: Ramon Orticio
Date:
Subject: programming language for postgresql