Recursive SQL giving ORA-01790

前端 未结 3 1426
自闭症患者
自闭症患者 2021-02-10 04:46

Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have same datatype as corresponding expression:

with intervals(time_interval)         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-10 05:31

    I have no idea about the type mismatch, but here is an alternative method to accomplish what I think you want (which works in 10gr2):

    select base_time + numtodsinterval( 10*(level-1), 'Minute')
    from (select trunc(systimestamp) base_time from dual)
    connect by base_time + numtodsinterval( 10*(level-1), 'Minute') < systimestamp
    

提交回复
热议问题