Re: [SQL] INSERT and SELECT
От
Eric BARROCA
Тема
Re: [SQL] INSERT and SELECT
Дата
Msg-id
87emcuu4f4.fsf@venus.fondation
Список
Дерево обсуждения
INSERT and SELECT Eric BARROCA <eric@netsystems.fr>
Re: [SQL] INSERT and SELECT Vladimir Terziev <vlady@school.digsys.bg>
Re: [SQL] INSERT and SELECT <kaiq@realtyideas.com>
Re: [SQL] INSERT and SELECT Stuart Rison <rison@biochemistry.ucl.ac.uk>
Re: [SQL] INSERT and SELECT "Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>
manually set serial type rob caSSon <rob@styro.lib.muohio.edu>
Re: [SQL] manually set serial type <kaiq@realtyideas.com>
Re:[OT]-[SQL] manually set serial type rob caSSon <rob@styro.lib.muohio.edu>
Re:[OT]-[SQL] manually set serial type Howie <caffeine@toodarkpark.org>
Stuart Rison writes:
> INSERT INTO table VALUES SELECT oid, 'test' FROM membre WHERE
> email="toto@toto.com";
I've tried it, but it doesn't work too ("paser error near or at select"),
even if I replace " by '.
The sample table "table" :- ID int4- login varchar()- password varchar()
I'd like to put into the ID culumn the result of (SELECT ...), into the
login column "test" and into the password one "testpass".
I've tried many queries like :
INSERT INTO table (id, login, password) VALUES SELECT oid, 'test',
'testpass' FROM membre WHERE email='toto@toto.com';
or
INSERT INTO table (id, login, password) VALUES ((SELECT oid FROM membre
WHERE email='toto@toto.com'), 'test', 'testpass');
or
INSERT INTO table (id, login, password) VALUES (SELECT oid, 'test',
'testpass' FROM membre WHERE email='toto@toto.com');
...
But nothing give me a result. I get always parse error near select, and I
can't figure why.
Best Regards,
Éric.
В списке pgsql-sql по дате отправления