Say I have a table with field like this:
ID Name Parent_ID
1 Maxim 1
2 Bruce 1
3 Jonas 3
4 Steve 4
5 Chloe 4
6 Paul 4
7 Frank 7
8 Paula 8
9 Martin 9
10 Hank 9
And I want to get a query with only top 3 different parent Ids, which would have Parent_ID of 1, 3, and 4 like below:
ID Name Parent_ID
1 Maxim 1
2 Bruce 1
3 Jonas 3
4 Steve 4
5 Chloe 4
6 Paul 4
How can I get this using MySQL. Can I use the LIMIT function. Can anyone help me?
Thanks.