[英]Why can not I associate a variable in a request that returns more than one field?
此過程將返回
錯誤代碼:1222:使用的SELECT語句具有不同的列數
CREATE PROCEDURE `dev_getDashBoard`(cognito VARCHAR(100))
BEGIN
DECLARE id_user,team_last INT;
SELECT ct.hasInvoice,ct.currentCredits,ct.hasPremium,u.lastTeam INTO team_last FROM configTeam ct
INNER JOIN users u ON u.lastTeam = ct.team_id
WHERE u.identityId = cognito COLLATE utf8_unicode_ci LIMIT 1
CALL otherProcedure(team_last);
END
sql總是返回一行。 為什么mysql會返回錯誤?
從SELECT
刪除其他列:
SELECT u.lastTeam INTO team_last
FROM configTeam ct INNER JOIN
users u
ON u.lastTeam = ct.team_id
WHERE u.identityId = cognito COLLATE utf8_unicode_ci
LIMIT 1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.