用navicat 8  给mysql 写查询的时候,应该如何声明变量呢?DECLARE bid int
set bid=1
insert into book_attr (goods_id,attr_id,attr_val)
select bookid,1 as attr_id,bookattr1 from book_old where bookid=bid
union all
select bookid,2 as attr_id,bookattr2 from book_old where bookid=bid;
delete from book_attr不行,,,,是否必须写存贮过程??我试了存储过程是可以的。