Skip to content
Advertisement

Sql: How can i get just last two duplicate rows between more duplicate rows

My table:

I want to get the rows they have in their id:

2,3 (for title_en = t1)

and

5,6 (for title_en = t2)

this is my code, but its not working:

thanks in advance.

Advertisement

Answer

This is tricky, particuarly in MySQL. I believe the following does what you want:

MySQL is finicky about the use of limit in subqueries in the where clause. It is usually okay for a scalar subquery — one that returns at most one row.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement