2017-04-17 106 views
0

嗨,當我把這個查詢選擇這個工作好,使輸出在mysql中where命令不起作用

select SUBSTR(img_address1,LOCATE('/',img_address2)+1,36)fROM content 

但是當我做這個查詢此做出錯誤

SELECT id from content WHERE ((SUBSTR(img_address2,LOCATE('/',img_address2)+1,5) LIKE'salam') 

和本作錯誤太

SELECT id from content WHERE ((SUBSTR(img_address2,LOCATE('/',img_address2)+1,5) = 'salam') 

和我的錯誤是:

SELECT id from content WHERE ((SUBSTR(img_address2,LOCATE('/',img_address2)+1,5) = 'salam') LIMIT 0, 25 
MySQL said: Documentation 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 0, 25' at line 1 

回答

0

SUBSTR之前有一個額外的開放支架(。刪除它將修復錯誤。

SELECT id from content WHERE (SUBSTR(img_address2,LOCATE('/',img_address2)+1,5) = 'salam') LIMIT 0, 25 
+0

哦,謝謝我能找到它你的權利 – nazanin