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 · 4358 views
    This topic created in 2599 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
        1
    quadrapop  
       Jun 24, 2019
    mysql 临时表很坑,把结果放进游标里咯
    caneman
        2
    caneman  
    OP
       Jun 24, 2019
    @quadrapop 如果结果集很大呢?游标会不会影响效率?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3149 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:36 · PVG 19:36 · LAX 04:36 · JFK 07:36
    ♥ Do have faith in what you're doing.