I have following table structure:
id customer_id version_num
1 1 1
2 1 2
3 2 1
4 2 2
5 3 1
6 3 2
7 3 3
I want results to be displayed as:
id customer_id version_num
2 1 2
4 2 2
7 3 3
I'm able to get the following results:
id customer_id version_num
1 1 1
3 2 1
5 3 1
Query that I used:
select * from TABLE group by customer_id
I don't know how to make use of latest(version_num) in my query.