0
我閱讀了大量關於此錯誤的帖子和回覆,但所有回覆都給出了具體問題的具體答案。有人能解釋一下問題是什麼,以及如何克服它,這樣我就不必在這裏發佈每個問題查詢。MySQL錯誤(1093)
這是我的程序
CREATE PROCEDURE `sp_FixEntityNames`(IN `importId` BIGINT UNSIGNED)
BEGIN
UPDATE ImportedSymbols s
JOIN ExchangeMappings m ON s.ExchangeMappingId = m.ExchangeMappingId
SET s.EntityName =
(
SELECT s1.EntityName
FROM ImportedSymbols s1
JOIN ExchangeMappings m1 ON s1.ExchangeMappingId = m1.ExchangeMappingId
WHERE
s1.ImportId = importId
AND
s1.Symbol = s.Symbol
AND
s1.Suffix = NULL
AND
s1.MarketId = NULL
AND
s1.SecurityTypeId = 1
AND
m1.NamespaceId = m.NamespaceId
)
WHERE
s.ImportId = importId
AND
(
s.Suffix != NULL
OR
s.MarketId != NULL
OR
s.SecurityTypeId != 1
);
END
嘗試在子查詢中包裝'SELECT s1.EntityName FROM ImportedSymbols s1 ...',然後從那裏選擇'EntityName'。 –
http://stackoverflow.com/a/45498/767881 –