Sqlserver2008下利用递归CTE生成连续日期
with temp as (select convert(datetime,'20120101') days),n as(select days from tempunion allselect n.days+1 from n where n.days<convert(datetime,'20150101'))select * from n option(maxrecursion 32767)...
wm_concat和listagg函数测试
关于这个帖子提到的两个函数http://www.itpub.net/thread-1717610-1-1.html 测试环境redhat linux with oracle 11g SQL> create table a as select 1 id,'x' t1 from dual union all select 2,'y' fro...
oracle物化视图简单测试
测试用数据库oracle 11g create table test as select rownum id, object_id,object_name from all_objects; alter table test add constraint pk_test primary key (id); --要使用...
oracle 外键失效的一些测试
create table p(id int primary key,val int)create table f(id int, constraint fkk foreign key (id) references p(id))insert into f values(null)drop table pdrop table f create table p(id1 int,id2 i...