我们有时会因为需要,而将筛选出来的数据创建成暂存表格,例如:我们可以将一个大表格中的不部分数据抽取出来,创建一个小的暂存表格,以便快速选取数据。一个暂存表格存储于暂存数据库tempdb之中,系统会在连接结束后自动清除它。
select a,b,c into productstemp from products

在SELECT语句中使用子查询

select * from distibutors where hsienshi_code=
(select hsienshi_code
from distributors
where boss_name='张江悦')

select supp_name form tablename where a in
(select distinct supp_code
from products where descriptions='主机板')

使用UNION运算符

SELECT statement1 UNION SELECT statement2
UNION会删除重复的记录

相关文章:

  • 2021-08-26
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-09-20
  • 2021-09-15
  • 2022-12-23
相关资源
相似解决方案