I am looking for the correct mysql query for my site http://watiseropderadio.nl (in Dutch). This is a website to find out which songs were played on the popular radio in Holland.
I want to make a query that returns 13 rows for each radio station. There are 8 different radio stations.
This is my table:
id | radioname | time | artist | song
--------------------------------------------------------------
23421 | radio 538 | 19:34 | Queen | Bohemian
23422 | radio veronica | 19:35 | Rammstein | Blablabla
23423 | slam fm | 19:34 | Roxette | Blablabla
23424 | 3fm | 19:34 | Blabla | Blablabla
....
This is a table with 3,000,000 + entries and with these keys:
PRIMARY PRIMARY 3083007 id
radioname INDEX 8 radioname
track with artist INDEX 23715 artist
song
This is what I want to be the output:
id | radioname | time | artist | song
--------------------------------------------------------------
23455 | radio 538 | 19:30 | Blabla | Blablabla
23470 | radio 538 | 19:33 | Blabla | Blablabla
23484 | radio 538 | 19:36 | Blabla | Blablabla
23498 | radio 538 | 19:38 | Blabla | Blablabla
total 13 x ....
23456 | radio veronica | 19:29 | Blabla | Blablabla
23476 | radio veronica | 19:32 | Blabla | Blablabla
23483 | radio veronica | 19:36 | Blabla | Blablabla
23495 | radio veronica | 19:39 | Blabla | Blablabla
total 13 x ....
The order of the result does not matter, and the query should be fast. I like to try it myself, but for me it is a little for me.
I don’t know if the key is suitable for this work, can anyone give some advice?
source
share