我有一个sqlite数据库。我试图在表书签中插入值(users_id,lessoninfo_id),只有在一行中不存在。
原文链接:https://www.f2er.com/sqlite/198280.htmlINSERT 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+")))