Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

max Qty of serial number without duplicated.

$
0
0

I have Query

SELECT Serial,Itemcode,ItemName,Storecode,factor,pckqty,qty,'' "varient in PCS"
FROM s_products where storecode='MEENA'   GROUP BY Itemcode,Serial,ItemName,Storecode,factor,pckqty,qty,Expirydate 
HAVING max(qty)>=0 order by Itemcode,qty desc

Out Put

199911490100021002SKIMMED MILK POWDER(SUN GOLD) 1X25 KGS MEENA1 25.010
199911669400021002SKIMMED MILK POWDER(SUN GOLD) 1X25 KGS MEENA1 25.015
199912861800021002SKIMMED MILK POWDER(SUN GOLD) 1X25 KGS MEENA1 25.05
19995591700021002SKIMMED MILK POWDER(SUN GOLD) 1X25 KGS MEENA1 25.06
19993928800021003SKIMMED MILK POWDER(BEST WAY) 1X25 KGS MEENA1 25.07
19994241100021003SKIMMED MILK POWDER(BEST WAY) 1X25 KGS MEENA1 25.05
19999586700021003SKIMMED MILK POWDER(BEST WAY) 1X25 KGS MEENA1 25.07
199911134400021004FULL CREAM MILK POWDER (BESTWAY) 1X25 KG MEENA1 25.00.0
199912398200021004FULL CREAM MILK POWDER (BESTWAY) 1X25 KG MEENA1 25.00.0
199915624700021004FULL CREAM MILK POWDER (BESTWAY) 1X25 KG MEENA1 25.00.0
199917221000021004FULL CREAM MILK POWDER (BESTWAY) 1X25 KG MEENA1 25.00.0

Iwant the Out like 

199911669400021002SKIMMED MILK POWDER(SUN GOLD) 1X25 KGS MEENA1 25.015

19999586700021003SKIMMED MILK POWDER(BEST WAY) 1X25 KGS MEENA1 25.07

199917221000021004FULL CREAM MILK POWDER (BESTWAY) 1X25 KG MEENA1 25.00.0

Tips Hiegst Qty ,Without duplicating ItemCode,Heighest Serial number ways record in above order


AK


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>