oracle数据查询问题
有500万条通话记录
编号 号码 被叫号码 开始时间 结束时间 通话时长
1 10010 20020 12:00 12:01 1
2 10010 20045 12:05 12:06 1
3 10012 30045 12:45 12:55 10
数据不是很正确
查询要求: 查询同一电话号码两次通话间隔大于10秒的所有编号 (数据没有秒自己添加)
分析:10010可能有五次通话,加入第四次结束与第五次开始时间间隔大于10秒那么这条数据就符合
第四次结束,第五次开始在哪里呢?
你给的数据和说明都没解释清楚哦,还是我看不懂。
数据没有秒自己添加
怎么个添加规则?
或者
select * from table1 t
where not exists(
select 1 from table1
where 号码=t.号码 and 开始时间-t.结束时间 between 0 and 10/24/3600)
and exists(
select 1 from table1
where 号码=t.号码 and 编号>t.编号)
drop table tb_mumu;
alter session set nls_date_formate='yyyy-mm-dd hh24:mi:dd';
create table tb_mumu (
ID number primary key not null,
主叫号码 varchar2(11) not null,
被叫号码 varchar2(11) not null,
通话开始时间 d
相关问答:
本来要写个update语句
update table_a A
set A.flag=1
where A.id in (select B.id from table_b B)
结果误写成
update table_a A
set A.flag=1
where ......
安装了Oracle 10g,默认安装了orcl数据库,这个数据库能不能删除啊,还有我如果新建了其他数据库,怎么知道在web中登陆不同数据库的地址啊?
1
可以删除
2
在WEB地址栏中输入地址的时候指定新创建的数据库的IP ......
exp user/password@dbname file=c:\table.dmp tables=jbitaku,jbitakum grants=y
然後按回車鍵 說明: user/password@dbname 分別表示用戶名,密碼和服務名 f ......
我在创建数据库的时候用的名字为oracle10,但是创建好后,在默认的目录下显示的名称却是oracle10g,这是为什么?
你看的 10g是安装目录吧
SQL> select name from v$database;
NAME
---------
ORCL
......