SOLVED Re: SELECT returnig a constant

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: SOLVED Re: SELECT returnig a constant
Date: 2019-10-15 13:34:55
Message-ID: 20191015133455.GA20700@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 15, 2019 at 09:28:51AM -0400, stan wrote:
> I used to be able to return a constant value in a SELECT statement in
> ORACLE. I need to populate a table for testing, and I was going to do so
> like this:
>
> SELECT
> employee.id ,
> project.proj_no ,
> work_type.type ,
> 'rate' 1
> FROM employee
> CROSS JOIN project
> CROSS JOIN work_type;
>
> This statement works correctly, till I add the last "'rate' 1 line, then it
> returns a syntax error.
>
> How can I do this?
>
Turns out this works.

SELECT
employee.id ,
project.proj_no ,
work_type.type ,
1 as rate
FROM employee
CROSS JOIN project
CROSS JOIN work_type;
~

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ray O'Donnell 2019-10-15 13:35:53 Re: SELECT returnig a constant
Previous Message stan 2019-10-15 13:28:51 SELECT returnig a constant