SQLite中的“插入如果不存在”语句
users_id
, lessoninfo_id
bookmarks
INSERT INTO bookmarks(users_id,lessoninfo_id) VALUES( (SELECT _id FROM Users WHERE User='"+$('#user_lesson').html()+"'), (SELECT _id FROM lessoninfo WHERE Lesson="+lesson_no+" AND cast(starttime AS int)="+Math.floor(result_set.rows.item(markerCount-1).starttime)+") WHERE NOT EXISTS ( SELECT users_id,lessoninfo_id from bookmarks WHERE users_id=(SELECT _id FROM Users WHERE User='"+$('#user_lesson').html()+"') AND lessoninfo_id=( SELECT _id FROM lessoninfo WHERE Lesson="+lesson_no+")))
语法附近的DB错误。
慕村225694
哈士奇WWW