Confusion in Insert Query syntax - Mailing list pgsql-general

From Shadkam Islam
Subject Confusion in Insert Query syntax
Date
Msg-id Pine.LNX.3.96.991006095532.24263D-100000@trishul.wipinfo.soft.net
Whole thread Raw
In response to Some information about JDBC  ("Ing. Arturo de la Torre" <adltor@waccom.net.ec>)
Responses Re: [GENERAL] Confusion in Insert Query syntax
List pgsql-general
Hi All,

If I type \h insert at psql it shows me,

        INSERT INTO class_name [(attr1, ...attrN)]
        VALUES (expr1,..exprN) |
        SELECT [DISTINCT [ON attrN]]
        expr1, ...exprN
        [FROM from_clause]
        [WHERE qual]
        [GROUP BY group_list]
        [HAVING having_clause]
        [ { UNION [ALL] | INTERSECT | EXCEPT } SELECT ...];


But when I tried the following query it gave the parse error


    INSERT INTO EffortTable (EffortID)
    VALUES (ValueForEffortID) |
    SELECT MAX(EffortID) AS ValueForEffortID
    FROM   EffortTable
    WHERE  ProjectID=200;

the error is --> ERROR:  parser: parse error at or near "|"


What is the syntax I should use.

Thanx in advance,
Shad.


pgsql-general by date:

Previous
From: Omega Weapon
Date:
Subject: copying from one table to another
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Confusion in Insert Query syntax