sql – 存储过程/函数可以返回一个表吗?
发布时间:2020-12-12 16:15:10 所属栏目:MsSql教程 来源:网络整理
导读:MySql存储过程/函数可以返回一个表,而不使用临时表吗? 创建以下过程 CREATE PROCEDURE database.getExamples() SELECT * FROM examples; 后来跟它说 CALL database.getExamples() 显示示例表 – 正如预期的那样 – 但以下似乎是不可能的: SELECT * FROM CAL
MySql存储过程/函数可以返回一个表,而不使用临时表吗?
创建以下过程 CREATE PROCEDURE database.getExamples() SELECT * FROM examples; 后来跟它说 CALL database.getExamples() 显示示例表 – 正如预期的那样 – 但以下似乎是不可能的: SELECT * FROM CALL database.getExamples() 是否可能从存储过程/函数返回查询结果表,如果是 – 如何? 解决方法至于现在,这是不可能的.这是documentation在FROM子句中可以使用的内容: table_references: table_reference [,table_reference] ... table_reference: table_factor | join_table table_factor: tbl_name [[AS] alias] [index_hint)] | table_subquery [AS] alias | ( table_references ) | { OJ table_reference LEFT OUTER JOIN table_reference ON conditional_expr } join_table: table_reference [INNER | CROSS] JOIN table_factor [join_condition] | table_reference STRAIGHT_JOIN table_factor | table_reference STRAIGHT_JOIN table_factor ON conditional_expr | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor join_condition: ON conditional_expr | USING (column_list) index_hint: USE {INDEX|KEY} [FOR JOIN] (index_list) | IGNORE {INDEX|KEY} [FOR JOIN] (index_list) | FORCE {INDEX|KEY} [FOR JOIN] (index_list) index_list: index_name [,index_name] ... 您可以看到,存储过程不在此列表中. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |