set @return=(SELECT u_id,u_pass from m_User where u_id = @userName AND u_pass=@userPass);
显示类似这样的错误
"Only one expression can be specified in the select list when the subquery is not introduced with EXISTS."
答案 0 :(得分:1)
您无法在子查询中选择多个列。
在这里,您要选择两列u_id,u_pass
。
根据需要只选择一个。
如果@return属于数据类型(例如,varchar,int)
set @return=(SELECT u_id from m_User where u_id = @userName AND u_pass=@userPass);
或
set @return=(SELECT u_pass from m_User where u_id = @userName AND u_pass=@userPass);