ask for help with a simple query!!!# Database - 数据库
p*p
1 楼
Could someone help me with the following query? Say there is a table with 2
columns, ProductID and ProductType
ProductID ProductType
1 C
2 B
3 A
4 B
5 A
6 C
7 A
8 B
how to write a query to return 2 products (order by ProductID) from each
producttype? In this case, return:
3 A
5 A
2 B
4 B
1 C
6 C
Use Transact-SQL, one query, no cursor is allowed.
Please help!!!!
columns, ProductID and ProductType
ProductID ProductType
1 C
2 B
3 A
4 B
5 A
6 C
7 A
8 B
how to write a query to return 2 products (order by ProductID) from each
producttype? In this case, return:
3 A
5 A
2 B
4 B
1 C
6 C
Use Transact-SQL, one query, no cursor is allowed.
Please help!!!!