请看以下,A0057是变量,应该传参数进去才行啊CREATE VIEW `tempdata`.`time_view` AS
SELECT c.code,c.time FROM customercomment c where c.code='A0057'
union all
SELECT c.code,c.time FROM customernote c where c.code='A0057';
SELECT c.code,c.time FROM customercomment c where c.code='A0057'
union all
SELECT c.code,c.time FROM customernote c where c.code='A0057';
You can only use prepare statement in store procedure.
FROM customernote c where c.code='A0057';