关于分组排序

利用over partion

 

(SELECT *, ROW_NUMBER()   
        over   
        (PARTITION By task_id   
        order by task_id) as rowId 
FROM CAMPAIGN_TASK_LOG where CAMPAIGN_TASK_LOG.AFTER_STATE in('10','15','21','22','23','24') 
		and ACTION_TYPE='surveysubmit'       ) as logs

 

 

 

refurl:http://blog.csdn.net/zzginfo/article/details/8069733

你可能感兴趣的:(排序)