简体   繁体   中英

Check the documentation for the version of MariaDB you are using for the correct syntax around 'DESC LIMIT 1) LIMIT 0, 50' on line 1

SELECT summary FROM cms_module_cgblog WHERE cgblog_id=(SELECT article_id FROM cms_module_cgblog_tags_link WHERE tag_id=979 DESC LIMIT 1);

Why is this request incorrect?

MySQL answer: Documentation

1064 - You have an error in your request. Check the documentation for the version of MariaDB you are using for the correct syntax around 'DESC LIMIT 1) LIMIT 0, 50' on line 1

For sorting in descending order you need to use: ORDER BY keyword

Your query should be like this -

SELECT summary FROM cms_module_cgblog WHERE cgblog_id=(SELECT article_id FROM cms_module_cgblog_tags_link WHERE tag_id=979 ORDER BY tag_id DESC LIMIT 1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM