解釋:此處查詢id不在pid出現,以/qwe開頭,userId為15的數據。子查詢加上where是為了加快查詢效率。
SELECT * from file where filePath like concat( "/qwe", '%') and userId =15 and id NOT IN(SELECT pid from file where filePath like concat( "/qwe", '%') and userId =15)
解釋:此處查詢id不在pid出現,以/qwe開頭,userId為15的數據。子查詢加上where是為了加快查詢效率。
SELECT * from file where filePath like concat( "/qwe", '%') and userId =15 and id NOT IN(SELECT pid from file where filePath like concat( "/qwe", '%') and userId =15)
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。