I need to use Distinct to return unique records by order number but I also need to return the rest of fields that are not part of the Distinct. For example:
SELECT Num, Type, Customer FROM Order_Table
Num Type Customer
------ ------ ------------
1 YY 1001 ABC
1 AA 1001 ABC
2 SD 2001 FFF
3 CC 5000 DDD
3 BB 5000 DDD
I would like to use Select Distinct by number but return more than just the number field. Type and Customer also need to be returned like below example:
Num Type Customer
------ ------ ------------
1 YY 1001 ABC
2 SD 2001 FFF
3 CC 5000 DDD
Is there a way to solve this? Thank you in advance!!
SELECT Num, Type, Customer FROM Order_Table
Num Type Customer
------ ------ ------------
1 YY 1001 ABC
1 AA 1001 ABC
2 SD 2001 FFF
3 CC 5000 DDD
3 BB 5000 DDD
I would like to use Select Distinct by number but return more than just the number field. Type and Customer also need to be returned like below example:
Num Type Customer
------ ------ ------------
1 YY 1001 ABC
2 SD 2001 FFF
3 CC 5000 DDD
Is there a way to solve this? Thank you in advance!!