怎么在SQL查询的结果里加行号? 学习了:https://zhidao.baidu.com/question/91188037.html mysql : ) as rowNo From a, () ) b oracle : select a.*,rownum from a sql server : select row_number()over(order by XX)as RowNum,* from a
SELECT end AS row_num_v_, case when @v <> _apply.PATIENT_ID then @v := _apply.PATIENT_ID else @v end AS row_num_v, _apply.ID, _apply.MEDICAL_CARD_NO, _apply.EXPERT_RESOURCE_ID, _apply.PATIENT_ID, _apply.DEPT_ID, _apply.REG_DATE, _apply.COMPANY_ID FR
select * from ( select @rownum:=@rownum+1 AS rownum, app_t.* from ( select * from app_custom where 1=1 ) app_t,(SELECT @rownum:=0) r ) as t where t.rownum between 1 and 10