提问人:Yoga Resta 提问时间:1/13/2023 最后编辑:marc_sYoga Resta 更新时间:1/13/2023 访问量:48
SELECT 列表中的列 CHDRNUM 或表达式无效。我是如何修复的?
Column CHDRNUM or expression in SELECT list not valid. How I fixed?
问:
SELECT
a.CHDRNUM, a.COWNNUM
CASE
WHEN COUNT(H.ENTITYCODE) > 0
THEN 'Y'
ELSE 'N'
END AS B
FROM
(SELECT CHDRNUM,COWNNUM
FROM CHDRPF) AS a
INNER JOIN
(SELECT ENTITYCODE, ENTITYTYPE, ISTATUS
FROM ZBLSPF
WHERE ENTITYTYPE = 'CN'
AND ISTATUS IN ('RED', 'RED 1', 'RED 2', 'RED 3', 'RED 4', 'RED 5')) AS H ON H.ENTITYCODE = A.COWNNUM
WHERE
a.CHDRNUM = '123';
为什么这 2 列不包含在选择列表中,但当我删除 2 列 () 时,它会运行。CHDRNUM, COWNNUM
我得到的错误是
SELECT 列表中的列 CHDRNUM 或表达式无效
答: 暂无答案
评论
GROUP BY
FROM (SELECT CHDRNUM,COWNNUM FROM CHDRPF) AS a
FROM CHDRPF AS a