Hi,
I'am new to informix and new to this forum. I am googling since two days and did read many pages in this forum but didn't find the solution for my problem:
Given is the table
country custname quantity
A aaa 1000
A bbb 900
A ccc 800
A ddd 700
A eee 600
B zzz 2000
B aaa 1900
B ggg 1800
B ttt 1700
B bbb 1600
B kkk 1500
B rrr 1400
CH aaa 3000
CH hhh 300
CH uuu 100
CH nnn 150
F ooo 1000
F aaa 200
F iii 100
I want to select the top 3 (quantity) for each country with one select.
The output shall look like this:
Country customer quantity
A aaa 1000
A bbb 900
A ccc 800
B zzz 2000
B aaa 1900
B ggg 1800
CH aaa 3000
CH hhh 300
CH nnn 150
F ooo 1000
F aaa 200
F iii 100
Who can help me?