declare gold int default 2; #不同方式: set gold = 100; select table_gold into gold from accountinfo where UserID = 520;
要把数据库查出来的数据赋值给局部变量,使用into