mysql 顺序号 示例

 select @rn:=@rn+1 as rn, a. * from
(select b.cont_id, cust_name, cont_mgr, item_name, agree_info, take_steps, cycle_id, deadline_date, evidence, provider, duty_dept, duty_user
from s0_cont_item_exec a, s0_cont_item b, s0_dic_cont_item c, s0_cont d, s0_cust e
where deadline_date between '${start_date}' and '${end_date}'
and b.cont_id like '%${cont_id}%'
and a.item_id=b.item_id and b.item_code=c.item_code
and b.cont_id1=d.cont_id and d.cust_id=e.cust_id
order by b.cont_id, b.oper_time, a.item_id ) a,
  (select @rn:=0) t2
;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值