CREATE TABLE [dbo].[S_Products] (
[Serial] [varchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ItemCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Qty] [float] NULL
)
// here serialno is unique but itemcode will occure 1 more times.
Sample Date
Serial Itemcode Qty
20135091 00551002 16.0
20135114 00551003 11.0
20135075 00551003 11.0
20135129 00551005 4.0
20135103 00551005 2.0
I want to get serial numnber ,qty corresponding to max of Qty which is > 0
plz give me the query for it. Plz note that my serial number is unique , but item code is multiple. So i one item code and qty and corresponding serial which is max(qty) > 0
AK