常见Oracle/SQL技巧和问题
技巧
子查询可以作为列,例如
select a.Score as Score,
(select count(distinct b.Score) from Scores b where b.Score >= a.Score) as Rank
from Scores a
order by a.Score DESC
使用rownum(oracle特有的关键字)进行分页
selectvalue intovary:将查询出的值写到定义的变量里
常用函数
函数
说明
NVL(X,V..
原创
2020-07-21 00:33:24 ·
160 阅读 ·
0 评论