mysql 语句,定义变量及使用 智能小怪兽 2024-10-24 36 阅读1分钟 其实就是直接 set 就好了,不需要先declare这样,而是直接用就ok。 set @ProductId = 765; select * from eb_store_product where product_id = @ProductId; select * from eb_store_product_attr_value where product_id = @ProductId;