1

下面的这个过程返回

错误代码: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返回错误?

4

1 回答 1

0

从 中删除其他列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
于 2017-02-07T12:19:46.123 回答