如何使用 ORACLE SQL 对特定行值进行操作?
技术问答
199 人阅读
|
0 人回复
|
2023-09-12
|
如何使用 ORACLE SQL 操作特定行值?3 l6 E+ n& }; h4 q; V4 A8 e
这是我的 SQL 语法。
. V3 y4 ]' l/ M6 r2 hSELECT (BASICPAY SUDANG) FROM( SELECT T2.*,ROWNUM AS RN FROM ( SELECT T.*,(BASICPAY SUDANG) FROM TBLINSA T WHERE SUBSTR(T.SSN,8,1) = ORDER BY BASICPAY SUDANG DESC )T2 )T3WHERE RN = 3UNIONSELECT (BASICPAY SUDANG) FROM( SELECT T2.*,ROWNUM AS RN FROM ( SELECT T.*,(BASICPAY SUDANG) FROM TBLINSA T WHERE SUBSTR(T.SSN,8,1) = 2 ORDER BY BASICPAY SUDANG DESC )T2 )T3WHERE RN = 9结果是:
" l ~7 K G, N- b& {# p d' {, V- Z(BASICPAY SUDANG)20700002670000在这里,我们需要找出 207000 和 267000 的区别。
6 c' F& Y ]- b, o. }! t* h/ G我很好奇如何获得这种差异。
" x# Z8 ]9 P. p' i1 h/ Q
2 ^' s+ ?" W9 S) A4 }, | 解决方案: |
|
|
|
|
|