表变量。 declare table @t_var

1. 声明表变量:declare table @tablename(columnname type), 如: declare table @t(id int);

2. 把查询 结果插入表变量中: insert into @t.columnname select id from table1, 把table1的id 插入@t中

原文地址:https://www.cnblogs.com/hellomandy/p/8068184.html