Hallo,

I'm trying to insert the highest value of tblName into tblZO.

There fore I followed the hints in this article ...
http://www.nabble.com/How-to-use-the-ROWID-of-the-last-inserted-row-for-FK-insert-into-other-tables--td19085514.html#a19085514

... but I got a error (see below)

SQLite version 3.3.13
Enter ".help" for instructions
sqlite> create 'tblName' ('id' integer primary key, 'text' text);
SQL error: near "'tblName'": syntax error
sqlite> create table 'tblName' ('id' integer primary key, 'text' text);
sqlite> insert into 'tblName' Values (NULL, 'one');
sqlite> insert into 'tblName' Values (NULL, 'two');
sqlite> insert into 'tblName' Values (NULL, 'three');
sqlite> insert into 'tblName' Values (NULL, 'four');
sqlite> insert into 'tblName' Values (NULL, 'five');
sqlite> create table 'tblRefMaxName' ('ref' integer, 'nn' text);
sqlite> insert into 'tblRefMaxName' Values (select max(id) from tblName,
'eins')
;
SQL error: near "select": syntax error
sqlite>

Can anybody help?

Leo
-- 
View this message in context: 
http://www.nabble.com/Error-on-INSERT-with-SELECT-Max%28id%29-FROM-...-tp22192949p22192949.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to