Re: Moving from TSQL to PL/pgsql select into a variable...

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron Clarke <rclarkeai(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Moving from TSQL to PL/pgsql select into a variable...
Date: 2019-03-18 14:57:46
Message-ID: CAKFQuwbYpWDjDYmE0fjrp8OTgRxNULaZYKMh3P-WDu3T8yGUuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

n Mon, Mar 18, 2019 at 7:53 AM Ron Clarke <rclarkeai(at)gmail(dot)com> wrote:
> SELECT cast('a' as varchar) AS X INTO myvar;

That is correct though you'll more often see:

myvar := SELECT cast('1' as varchar);

> SELECT myvar;

That is the SELECT statement that doesn't have a result.

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2019-03-18 15:06:19 Re: Moving from TSQL to PL/pgsql select into a variable...
Previous Message Ron Clarke 2019-03-18 14:52:56 Moving from TSQL to PL/pgsql select into a variable...