一些常用查询

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

③   完全外连接

④   左外连接

⑤   右外连接

最新文章

  1. 【转】深入理解SQL的四种连接-左外连接、右外连接、内连接、全连接
  2. EL表达式查询出来的数据,下载成excel表格,很实用的
  3. MapReduce中作业调度机制
  4. leetcode之链表排序题
  5. 使用NODEJS+REDIS开发一个消息队列以及定时任务处理
  6. XML 文档解析操作
  7. 初识Channel
  8. java.sql.SQLException:Invalid value for getInt()-'zhangsan'
  9. CJSON create.c
  10. GYM 101173 K.Key Knocking(构造)
  11. nodeclub config
  12. 使用C# 开始第一个QQ机器人
  13. 一点记忆—— Java框架知识的学习有感
  14. IMAP简单研究
  15. vertex shader(1)
  16. 【枚举】Petrozavodsk Summer Training Camp 2016 Day 6: Warsaw U Contest, XVI Open Cup Onsite, Sunday, August 28, 2016 Problem G. Equation
  17. Hbase系列-Hbase简介
  18. log4j配置文件中的additivity属性
  19. (ADO.NET)SqlCommand参数化查询
  20. java面试题05

热门文章

  1. tp5怎么防sql注入 xss跨站脚本攻击
  2. gitee的使用
  3. Vue2.0双向数据绑定原理
  4. Control Flow in Tensorflow TF中的控制流解析
  5. NTFS权限详解
  6. java反射之java 泛型的本质
  7. 面板Panel
  8. 旅游清单一步搭建,Angular助力你的踏春计划
  9. vue2.x版本中computed和watch的使用入门详解-关联和区别
  10. z-index原理及适用范围