在Oracle中,通过从双重连接级选择级别< 10,可以生成整数的子查询并将其转换为另一个序列。
这和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中,减去的模拟值是:
select whatever from table1 T1
where not exists
( select 1 from table2 where id = T1.id )但我不知道的级连接的模拟.
UPDATE有没有办法在Sybase中创建临时表而不将数据实际存储到磁盘?
发布于 2013-05-18 13:23:05
您使用的Oracle语法是用作行生成器的分层查询。Sybase具有行发生器系统过程,可用于在起始值和结束值之间生成一组整数。
下面将生成1到255之间的整数列。
SELECT row_num FROM sa_rowgenerator( 1, 255 );发布于 2017-12-15 08:42:36
sa_rowgenerator系统程序需要DBA授权。未经DBA授权的用户必须被授予运行存储过程的执行权限。
https://stackoverflow.com/questions/16624620
复制相似问题