问题
Can i pass table variable as a PARAMETER To a Stored Procedure in MySql
回答1:
If you want to pass a table into the stored procedure as parameter - then answer is no. Only scalar values can be passed.
The table can be accessed by its name directly; if you want to use that table name to construct and run new query in procedure, then have a look at prepared statements.
回答2:
yes
TableA:
MyId MyNumber
1 5
2 6
3 9
Select myNumber, MyStoredProcedure(MyNumber) from TableA where MyNumber > 5
来源:https://stackoverflow.com/questions/8118247/table-variable-as-a-parameter-in-my-sql-stored-procedures