当前位置:网站首页>mysql存储过程返回的结果集的问题
mysql存储过程返回的结果集的问题
2022-07-22 07:31:00 【CSDN问答】
mysql存储过程返回的结果集的问题
DELIMITER $$USE `crj`$$DROP PROCEDURE IF EXISTS `crj_duty`$$CREATE DEFINER=`root`@`%` PROCEDURE `crj_duty`()BEGINSET @EE='';SELECT @EE :=CONCAT(@EE,'max(if(duty_type= \'',duty_type,'\',duty_name,NULL)) as ',duty_type, ',') AS aa FROM (SELECT DISTINCT duty_type FROM sks_duty_info) A ;SET @QQ = CONCAT('select ifnull(c.parent_id,\'TOTAL\')as parent_id,',@EE,' b.duty_time from sks_duty_info c,sks_duty_days b WHERE c.parent_id=b.id group by parent_id order by b.duty_time asc');-- SELECT @QQ;PREPARE zbb FROM @QQ;EXECUTE zbb;DEALLOCATE PREPARE zbb;END$$DELIMITER ;**执行结果****期望结果**我只想要第二个结果集,我该如何处理?
边栏推荐
- cpd配准存在的问题
- 网络之物理层
- 深说浅谈DOM对象,用4个版本demoplus让你扭断history.state头(更)
- 如何一边看全景一边预约点餐?VR餐饮系统教程来了
- [HMS core] [push kit] set of message classification problems
- [harmony OS] [ark UI] [demo] loading animation
- Critical path problem
- 【数据库】MySQL表的增删改查(进阶)
- C language branch structure and loop structure (1)
- Using dichotomy to find the elements of an array
猜你喜欢
[cloud native] docker deployment database persistence
(十一)51单片机——用AT24C02实现存储秒表数据(附成果展示)
数据湖(十八):Flink与Iceberg整合SQL API操作
Real time synchronization and conversion of massive data based on Flink CDC
关键路径实现
Zabbix5.0.8-ODBC监控oracle11g
OSPF special area comprehensive experiment
如何一边看全景一边预约点餐?VR餐饮系统教程来了
MySQL series article 4: execution plan
Overview of nftfi track layout
随机推荐
Critical path problem
关键路径问题
深说浅谈DOM对象,用4个版本demoplus让你扭断history.state头(更)
C#静态类和静态类成员
备战攻防演练,这里有一张腾讯安全重保布防图!
如何一边看全景一边预约点餐?VR餐饮系统教程来了
数据湖(十八):Flink与Iceberg整合SQL API操作
毕业985,工作996,也躲不开中年危机
How does win11 run as an administrator? Win11 setup method running as Administrator
(11) 51 Single Chip Microcomputer -- realize the storage of stopwatch data with AT24C02 (attached with achievement display)
QWidget添加右键菜单
Shell脚本案例---2
[HMS core] [FAQ] [account kit] typical problem set 2
使用 Abp.Zero 搭建第三方登录模块(三):网页端开发
MySQL series 3: Function & Index & View & error code number meaning
[external sorting] fast sorting idea completes external sorting
【HMS core】【FAQ】【Account Kit】典型问题集2
线上推广新方式,VR全景展示如何吸引用户的关注?
为什么有些参数reload就可以生效,而有些参数必须重启数据库?
Detailed explanation of inheritance