Home > database >  Mysql subquery limit the query result rows
Mysql subquery limit the query result rows

Time:03-26

Dear, I have a question
I have a select * from tb1 where tag IN (select DISTINCT (tag) from tb1) such a SQL
My son returned to 10 data in the query, but I want the latest three, I tried the following SQL
Select * from tb1 where tag IN (select DISTINCT (tag) from tb1 order by tag DESC limit (3) the following error
This version of MySQL doesn 't yet support' LIMIT & amp; IN/ALL/ANY/SOME subquery '

Is there a way to realize the subquery in the result set is the latest three lines?
  • Related