Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

Tags:

mysql

SELECT MAX(issue) AS issue_one FROM issue_list
WHERE issue NOT IN (SELECT issue FROM issue_list ORDER BY id ASC LIMIT 46);

what is wrong with this query. it says. This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

The thing I want to do here is get the maximum value of issue from issue_list table neglecting first 46 rows.

How to do that?

like image 345
roman Avatar asked Nov 20 '25 06:11

roman


1 Answers

As Mihai mentions in his comment: try wrapping the sub-select in another sub-select. Looks dirty but is as close to your original query as you're going to get. Hence:

SELECT MAX(issue) AS issue_one 
FROM issue_list
WHERE issue NOT IN 
(SELECT issue from 
 (SELECT issue FROM issue_list ORDER BY id ASC LIMIT 46) x
);
like image 107
Tom Mac Avatar answered Nov 22 '25 22:11

Tom Mac



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!