My sql string is like:
SELECT t.*
FROM table AS t
GROUP BY t.month
the result like:
ID data month
1 0 1
2 1 2
3 2 4
4 3 5
I need select in ,for example,the first five month,so I need right outer join another table, the table is like this:
month
1
2
3
4
5
It's not a real table in database, my expecting result is like:
ID data month
1 0 1
2 1 2
3
3 2 4
4 3 5
how do I write this query?