我有一個表wp_posts與列post_content。一些帖子條目在post_content列中有[nggallery id = x]。我想找到所有帖子以及x(gallery id no,它不同於不同的圖庫),在post_content列中有nggallery id。我該怎麼辦?Mysql查詢幫助
0
A
回答
0
也許他的意思是這樣的:
SELECT * FROM wp_posts WHERE POST_CONTENT LIKE 「[nggallery ID =%]」
的MySQL字符串比較函數:http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
1
你可以嘗試這樣的:
SELECT * FROM wp_posts WHERE post_content LIKE '%[nggallery id=%';
1
試試這個,只是不問:)
select
left(substring(post_content,locate('[nggallery id=',post_content)+14,5),locate(']',substring(post_content,locate('[nggallery id=',post_content)+14,5))-1) as NumValue, post_content
from wp_posts
WHERE post_content LIKE "[nggallery id=%]"
ORDER BY 1
相關問題
- 1. MySQL查詢幫助
- 2. MySQl查詢幫助
- 3. 幫助MySQL查詢
- 4. MYSQL查詢幫助
- 5. MySQL查詢幫助
- 6. MySQL查詢幫助
- 7. 幫助MySQL查詢
- 8. 幫助MySQL查詢
- 9. Mysql查詢幫助
- 10. MySQL查詢幫助
- 11. mySQL查詢幫助
- 12. 幫助MySQL查詢
- 13. 幫助mysql查詢
- 14. MySQL查詢幫助
- 15. 幫助MySQL查詢
- 16. MySQL查詢幫助
- 17. MySQL查詢幫助
- 18. MySQL查詢幫助
- 19. MySQL查詢幫助?
- 20. MySQL查詢幫助
- 21. mysql查詢幫助?
- 22. MySQL查詢幫助
- 23. 幫助MySQL查詢
- 24. MySQL查詢幫助
- 25. MySQL查詢幫助
- 26. 幫助MySQL查詢
- 27. 幫助,MySQL查詢
- 28. MySQL查詢幫助
- 29. MySql查詢幫助
- 30. 幫助MySQL查詢
當在這裏發佈SQL問題時(以及更好的一些示例數據以及迄今爲止您嘗試過的查詢無法正常工作),您應該始終發佈您的表模式。 – jadarnel27
這是很難忍受你的問題。 – user482594