看到有人问如下问题:

SQL 一个update问题

花了些时间,弄出来了,记录如下:

SQL 一个update问题

 

核心代码:

update t_test t1 set num = (
       select num from (
              select rowid id,  row_number() over (partition by id order by id asc) num from t_test
       ) t2 where t1.rowid = t2. id  
);

 

空了,准备再弄下行列转置问题。

相关文章:

  • 2022-02-28
  • 2021-07-30
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2022-02-15
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2021-07-28
  • 2022-02-07
相关资源
相似解决方案