Created
December 23, 2018 15:37
-
-
Save Kcko/60584b847e643ea4e8a451437525a1a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from clanky where (kategorie, datum) in (select kategorie, max(datum) from clanky group by kategorie) | |
SELECT | |
t1.id, | |
t1.nadpis, | |
t2.datum, | |
t1.datum, | |
t2.kategorie | |
FROM clanky t1 | |
JOIN ( SELECT t2.kategorie, MAX(t2.datum) datum FROM clanky t2 GROUP BY t2.kategorie) t2 | |
ON t1.kategorie = t2.kategorie | |
AND t1.datum = t2.datum | |
select * from clanky t1 | |
where t1.id in (select max(t2.id) id from clanky t2 group by t2.kategorie) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment