sql server总结二
2024-08-28 12:23:48
一些常用查询
Insert into
表(字段一,字段二,字段三,………)
values(插入一,插入二,插入三,…………)
Update
表 set
字段= where
字段=
Delete from
表 where
字段=
(没有where后面则是删除表里所有数据)
4
一些不常用但偶尔也会用到的
① Exists
表一为product
表二为Blogs表
查询product表中与Blogs表中id相同的数据(exists)
select * from product where exists(select BlogId from Blogs where product.ID=Blogs.BlogId)
查询product表中有Blogs表中没有的数据(not exists)
select * from product where not exists(select BlogId from Blogs where product.ID=Blogs.BlogId)
② 内连接join
on
product表
Blogs表
内连接(join on)
select * from product join Blogs on Blogs.BlogId=product.ID
③ 完全外连接
④ 左外连接
⑤ 右外连接
最新文章
- 【转】深入理解SQL的四种连接-左外连接、右外连接、内连接、全连接
- EL表达式查询出来的数据,下载成excel表格,很实用的
- MapReduce中作业调度机制
- leetcode之链表排序题
- 使用NODEJS+REDIS开发一个消息队列以及定时任务处理
- XML 文档解析操作
- 初识Channel
- java.sql.SQLException:Invalid value for getInt()-'zhangsan'
- CJSON create.c
- GYM 101173 K.Key Knocking(构造)
- nodeclub config
- 使用C# 开始第一个QQ机器人
- 一点记忆—— Java框架知识的学习有感
- IMAP简单研究
- vertex shader(1)
- 【枚举】Petrozavodsk Summer Training Camp 2016 Day 6: Warsaw U Contest, XVI Open Cup Onsite, Sunday, August 28, 2016 Problem G. Equation
- Hbase系列-Hbase简介
- log4j配置文件中的additivity属性
- (ADO.NET)SqlCommand参数化查询
- java面试题05