› MySQL 5.5 Community Server
› MySQL 5.6 Community Server
› Percona Configuration Wizard
› XtraBackup 搭建主从复制
Great Sites on MySQL
› Percona
› MySQL Performance Blog
› Severalnines
推荐管理工具
› Sequel Pro
› phpMyAdmin
推荐书目
› MySQL Cookbook
MySQL 相关项目
› MariaDB
› Drizzle
参考文档
› http://mysql-python.sourceforge.net/MySQLdb.html
caneman
V2EX  ›  MySQL

如何把 MySQL 存储过程查询的结果作为一张表进行进一步查询?

  •  
  •   caneman · Jun 24, 2019 · 4482 views
    This topic created in 2698 days ago, the information mentioned may be changed or developed.

    例如

    create procedure a (in id int)
    begin
    select * from goods where cate_id = id;
    end;
    

    我想在 a 的结果中进一步查询,该怎么实现呢?

    还有就是在以上的基础上,如何给id设置一个默认值?

    2 replies  •  2019-06-24 17:55:24 +08:00
    quadrapop
    quadrapop
    Jun 24, 2019
    1
    mysql 临时表很坑,把结果放进游标里咯
    caneman
    caneman
    OP
    Jun 24, 2019
    2
    @quadrapop 如果结果集很大呢?游标会不会影响效率?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1214 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:39 · PVG 07:39 · LAX 15:39 · JFK 18:39
    ♥ Do have faith in what you're doing.