Nirmal KumarC

Nirmal KumarC

  • NA
  • 327
  • 79.6k

How to get highest id in same date with different id ?

Oct 4 2014 2:59 AM
Query
select     ltrim(rtrim(ltrim(isnull(BI.EID,'')))) from BATCHID BI,CO_BATCH_MASTER CBM  where bi.BID = CBM.cbm_batch_id and bi.B_ACTIV<>'D' and CBM.cbm_active<>'D' 
and cbm.cbm_batch_start_dt < @cbm_batch_start_dt and CBM.cmn_minor_code=@cmn_minor_code ORDER BY cbm_batch_start_dt DESC 
 
This Above query wise my result get  data same date(20/08/2014)
PSSR/B1269 
STSDSD/B95 
SSO/B255 
STSDSD C/B58 
DECGS/B17 
STSDSD/B96 
SSO/B256  
  After This data i want SSO/B255,SSO/B256 this  two data greater than I want Result is SSO/B256

Finall I am incremnt Result  is PSSR/B1270          
DECGS/B18          
STSDSD/B97        
SSO/B257          
Thanks