https://style.potepan.com/articles/23566.html
DB2的方法
select
row_number() over(order by jan_code asc) as "ID"
,jan_code as "JANコード" from table
MySQL的方法
SELECT (@i:=@i+1) as 序号,id,name FROM pcd,(select @i:=0)as it where pid = 0;
https://style.potepan.com/articles/23566.html
select
row_number() over(order by jan_code asc) as "ID"
,jan_code as "JANコード" from table
SELECT (@i:=@i+1) as 序号,id,name FROM pcd,(select @i:=0)as it where pid = 0;