Stuart Rison <rison@biochemistry.ucl.ac.uk> 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.