-1
我正在嘗試執行2 SELECT
查詢。當子查詢未與EXISTS一起引入時,只能在選擇列表中指定一個表達式。 3
我有以下幾點:提前
SELECT DISTINCT
A.USERNUMBER, B.USERNAME
(SELECT
B.USERNUMBER, COUNT(1)
FROM B
INNER JOIN A ON B.USERNUMBER = A.USERNUMBER
WHERE
A.USERNUMBER = B.USERNUMBER
AND B.PBALANCE <> '0'
OR B.IBALANCE <> '0'
OR B.SCBALANCE <> '0'
GROUP BY B.USERNUMBER)
FROM
A
INNER JOIN
B ON A.USERNUMBER = B.USERNUMBER
WHERE
A.USERNUMBER = B.USERNUMBER
感謝。
父查詢和子查詢具有相同的表名並且子查詢已經返回一列而不是多個 –