【发布时间】:2013-05-13 12:59:30
【问题描述】:
通过在Oracle中从双重连接中选择级别,我可以生成整数的子查询并将其转换为另一个序列。
Sybase 可以做到这一点吗?
PS 我想查找表中没有数据的日期(缺失天数)。在 Oracle 中,我这样做:
select to_date('2012-01-01', 'yyyy-mm-dd')+level-1 from dual
connect by level < to_date('2013-01-01', 'yyyy-mm-dd') - to_date('2012-01-01', 'yyyy-mm-dd')
MINUS
select distinct date from TBL
where date between to_date('2012-01-01', 'yyyy-mm-dd')
and to_date('2013-01-01', 'yyyy-mm-dd')
在 Sybase 中 MINUS 的模拟是:
select whatever from table1 T1
where not exists
( select 1 from table2 where id = T1.id )
但我不知道按级别连接的模拟...
更新有没有什么方法可以在 Sybase 中创建临时表而不实际将数据存储到磁盘?
【问题讨论】: