Oracle
文章平均质量分 73
iadink
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Oracle的trunc和dbms_random.value随机取n条数据
今天在review项目代码的时候看到这样一个问题,有一张号码表,每次需要从这样表中随机取6个空闲的号码,也就是每次取出来的6个号码应该都会有所不同。然后我就看到了这样的SQL select t.* from tel_number_tbl t where t.status = '空闲' and t.area_code = '0571转载 2016-03-16 17:20:02 · 3621 阅读 · 1 评论 -
oracle的参数优化
目前总结的语句,在查看数据的连接情况很有用,写完程序一边测试代码一边查看数据库连接的释放情况有助于分析优化出一个健壮的系统程序来。 1. Sql代码 1.select count(*) fromv$process select count(*) from v$process --当前的数据库连接数 2. Sql代码 1.select value from v$parameter转载 2016-02-23 13:21:20 · 996 阅读 · 0 评论 -
oracle 查询当前记录的上一条记录或下一条记录
上一条 select * from cms_article a where id = (select c.p from (select t.id, lag(t.id, 1, 0) over(order by t.sort) as p from cms_article t) c转载 2016-06-29 13:39:33 · 6118 阅读 · 0 评论 -
oracle 多表关联更新,需要更新的字段在另一个表里(lfn)
update customers a -- 使用别名 set city_name=(select b.city_name from tmp_cust_city b where b.customer_id=a.customer_id) where exists (select 1 from tmp_cust_city b where b.customer_id=a.cus转载 2018-02-06 22:18:55 · 3218 阅读 · 0 评论
分享