I have some kind of impossible request :).
I have a table where one of the columns is named type
. I would like to SELECT 3 records for each type in that column. Is that possible?
Note also that I'm using MySQL and Sphinx.
UPDATE:
Table structure
id title type
1 AAAA string1
2 CCCC string2
3 EEEE string2
4 DDDD string2
5 FFFF string2
6 BBBB string2
6 BBBB string2
What I want my MySQL to return is (up to 3 records for each type ordered by title):
id title type
1 AAAA string1
6 BBBB string2
2 CCCC string2
4 DDDD string2
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…