1
Azure SQLデータウェアハウスは、サブクエリ構造を持つ複数列のIN/NOT INをサポートしていますか?Azure SQLデータウェアハウスの複数列IN/NOT INサブクエリ
ようなクエリ実行されている:
select
*
from
schema_name.calendar
where
gregorian_date > '1998-01-01'
and gregorian_date < '1999-01-01'
and (yr_wk, day_of_wk) not in (select yr_wk, day_of_wk from schema_name.calendar where week = 25)
;
select
*
from
schema_name.calendar
where
gregorian_date > '1998-01-01'
and gregorian_date < '1999-01-01'
and (yr_wk, day_of_wk) in (select yr_wk, day_of_wk from schema_name.calendar where week = 25)
を。
エラーが発生しました。
SQL Error [103010] [S0001]: Parse error at line: 7, column: 14: Incorrect syntax near ','.
com.microsoft.sqlserver.jdbc.SQLServerException: Parse error at line: 7, column: 14: Incorrect syntax near ','.
内部または外部結合を持つ派生テーブルにクエリを書き換えるための回避策はありますか?
select
*
from
schema_name.calendar
where
gregorian_date > '1998-01-01'
and gregorian_date < '1999-01-01'
and (yr_wk) not in (select yr_wk from schema_name.calendar where week = 25)
;
select
*
from
schema_name.calendar
where
gregorian_date > '1998-01-01'
and gregorian_date < '1999-01-01'
and (yr_wk) in (select yr_wk from schema_name.calendar where week = 25)
;