Skip to content
Advertisement

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

Advertisement

Answer

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);
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement