0
我不能執行下面的過程和麪對錯誤:錯誤1064:多個串中的毗連組合()函數:MySQL的
1064 Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'aid=ass333' at line 1
CREATE DEFINER=`root`@`localhost` PROCEDURE `ref_table`()
BEGIN
declare t_name varchar(20);
declare aid1 varchar(20);
declare get_email varchar(20);
set @aid1 := 'ass333';
set @t_name := (select table_name from aid_ref where [email protected]);
set @get_email= CONCAT("SELECT email FROM ",@t_Name,"where aid=",@aid1);
Prepare stmt FROM @get_email;
Execute stmt;
End
如果我執行相同的程序,而不用(「,其中援助=」 @ AID1);在concat函數然後我得到的功能的所有電子郵件的名單,不過,我需要從這個過程
set @get_email= CONCAT("SELECT email FROM ",@t_Name,"where aid=",@aid1);
我跑你的代碼 「錯誤代碼:1054.'where子句'中的未知列'ass333'」。 我曾經多次遇到這個錯誤。 – Arun3x3