Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: Use a select statement for stored procedure parameter

I have a stored procedure that works:

call my_procedure('A,B,C,D');

I want to populate the A,B,C with a list from a subquery of another table, eg:

call my_procedure(
  SELECT group_concat(letters) FROM table WHERE type = 'some_type')
);

Possible? Or am I doing it wrong?

like image 291
OliverSamson43 Avatar asked Mar 04 '26 12:03

OliverSamson43


1 Answers

SELECT my_function(group_concat(letters)) FROM table WHERE type = 'some_type';
like image 103
Sebas Avatar answered Mar 06 '26 00:03

Sebas