报错:Result consisted of more than one row
参数 : `product_type` int,`app_id` bigint
返回: varchar(64)
BEGIN
#Routine body goes here...
declare typeName varchar(64);
select name into typeName from t_b_product_type where product_type = `product_type` and app_id = `app_id` ;
RETURN typeName;
END
报错:Result consisted of more than one row 。我看了下测试数据,只有一条符合上面的查询条件,不可能有多条记录。
修改为:
在select into 语句末尾添加 limit 1. 就能正常执行
或者给表添加别名,也能得到正确结果,
BEGIN
#Routine body goes here...
declare typeName varchar(64);
select name into typeName from t_b_product_type as a where a. product_type = `product_type` and a.app_id = `app_id` ;
RETURN typeName;
END
请教各位,这是什么情况。
相关推荐
TiO2 hierarchical nanostructures: Hydrothermal fabrication and application in dye-sensitized solar cells
Arrays of TiO2 hierarchical nanostructures that consisted of rutile nanorods and anatase branches we
分布式数据库的中间件
Official website:DocumentOverviewApache ShardingSphere is an open-source ecosystem consisted of a se
Perovskite solar cell based on network nanoporous layer consisted of TiO2 nanowires and its interface optimization
通过原位水热合成在SnO2:F(FTO)玻璃基板上制备了具有三维网络纳米多孔结构的Ana
Influence of family structure and school variables on behavior disorders of children
Influence of family structure and school variables on behavior disorders of childrenINFLUENCE OF FAM
山东省寿光中学2015_2016学年高二英语上学期期中试题扫描版
**语法和词汇**:如"consisted of"应改为"consists of",表示家庭由五人组成;"in her children"应改为"on her children",表示对孩子严格;"children


