반응형
SET @tmp1 = '12,13,14,15';
SET @xxx := CONCAT("SELECT * FROM t_user_master_card where user_seq = 1 and master_card_seq in (", @tmp1, ")");
SELECT @xxx;
PREPARE stmt FROM @xxx ;
EXECUTE stmt ;
DEALLOCATE PREPARE stmt ;
SET @tmp2 = 15;
SET @xxx := CONCAT("SELECT * FROM t_user_master_card where user_seq = 1 and master_card_seq in (?)");
SELECT @xxx;
PREPARE stmt FROM @xxx ;
EXECUTE stmt USING @tmp2 ;
DEALLOCATE PREPARE stmt ;
반응형