how can we call store procedure in where clause

前端 未结 1 1379
鱼传尺愫
鱼传尺愫 2021-01-28 11:10

How can I call a MySQL procedure in where clause?

In the example demo is a table name get_name() is a function and 1 is a paramete

相关标签:
1条回答
  • 2021-01-28 11:43

    You should use a function instead of a procedure. A procedure returns a (one or multiple) result sets (tables), whereas a function returns a single value.

    You should think twice before using functions in where-clause, if they contain select clauses from the database, as it may lead into situation where the query optimizer unable to optimize the query path resulting serialized queries and poor performance. If the data amount is small or you are ok with the possible performance hit, this would work.

    0 讨论(0)
提交回复
热议问题