2016-07-14 20 views
1

SQLはSQL Serverは、以下の

with mytable(a,b) as (
    values(
    (select current timestamp from sysibm.sysdummy1), (select current timestamp from sysibm.sysdummy1)) 
) 
select * from mytable 

私は以下のこの

with mytable(a,b) as (
values(
(select current_timestamp), (select current_timestamp)) 
) 
select * from mytable 

エラーを与えるときに私は、SQL Serverの中に似た何かを実行したい提起DB2で問題なく動作します:

Error: Incorrect syntax near the keyword 'values'. SQLState: S1000 ErrorCode: 156 Error: Incorrect syntax near ','. SQLState: 42000 ErrorCode: 102 Error: Incorrect syntax near ')'. SQLState: 42000 ErrorCode: 102

アイデア?

答えて

1

あなたはvaluesを残すことができます:

with mytable(a, b) as (
     select current_timestamp, current_timestamp 
    ) 
select * 
from mytable; 
関連する問題