テーブルに 3 つのフィールドを選択したい: 最初と 2 番目はbool
. 3番目は(fist = 0 && second = 0)
:
私はこれを試しました:
SELECT
CASE ..condition1..
THEN 1
ELSE 0
END
AS first,
CASE ..condition2..
THEN 1
ELSE 0
END
AS second,
CASE
WHEN newTable.first = 0 AND newTable.second = 0
THEN 1
ELSE 0
END
AS third
INTO newTable
FROM oldTable
しかし、私はエラーが発生しています:
The multi-part identifier "newTable.first" could not be bound;
The multi-part identifier "newTable.second" could not be bound.
何か提案していただけませんか?
このクエリの 3 番目のフィールドに入力する方法はありますか?