Skip to content
Advertisement

Getting the all rows of with any of the lastest N tags

I need to get the all the records of the N latest Tags, i.e. ordered by timestamp.

I’ve managed to construct the following query that retrieves the latest 20 tags. However when I try to join on the result, the “limit” will affect the total number of rows, and not the number of unique tags.

So given the following table…

… A query for the lastest 3 latests tags should output the following or similar:

Advertisement

Answer

If you want the most recent 20, with duplicates:

If you want the most recent 20 without duplicates:

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