Omit the values keyword since you do not have any values (you are using a select instead).
INSERT OR REPLACE INTO SONGS (skipcount) SELECT substr( custom5, 1, 4) FROM SONGS WHERE custom5 > '0000%' and skipcount < cast(substr(custom5, 1, 4) as int); the Values clause introduces a constant row to insert, as in insert into x (a,b,c,d) values (1,2,3,4); > -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Kristopher Roy > Sent: Sunday, 22 September, 2013 16:31 > To: sqlite-users@sqlite.org > Subject: [sqlite] Compare and INSERT INTO syntax issue > > I am trying to grab the value of custom5 0000% and compare it to > skipcount > and then if it is a higher value write it to skipcount, but something is > wrong with my syntax, can anyone help? > > INSERT OR REPLACE INTO SONGS (skipcount) Values SELECT substr( custom5, > 1, > 4) FROM SONGS WHERE custom5 > '0000%' and skipcount < cast( substr( > custom5, 1, 4) as int ); > > -- > Thank You, > Kristopher C. Roy > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users