我想在我的表中选择 3 个字段:第一个和第二个是bool
. 第三是(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.
你能给我一些建议吗?
有没有办法填写此查询中的第三个字段?