zoukankan      html  css  js  c++  java
  • SQL高级查询

    高级查询:

    一、多表链接

    1,普通查询

    select * from 表名,表名 where 表名.列名 = 表名.列名

    2,join链接

    select * from 表名 join 表名 on 表名.列名 = 表名.列名

    二、多表联合

    select * from 表名 where 列名='内容' union select * from 表名 where 列名='内容'

    三、子查询(无关子查询)

    select * from 表名 where 列名 = (select 列名 from 表名 where 列名='内容') 查单条数据用= !=非此条数据之外的内容

    select * from 表名 where 列名 not in (select 列名 from 表名 where 列名='内容' 列名 = '内容') 查多条数据用in not就是非此类条件

    四、子查询(相关子查询)

    select * from 表名 定义名 where 定义名.列名<(select avg(列名)from 表名 定义名 where 定义名.列名 = 定义名.列名)

  • 相关阅读:
    Python基础学习笔记(一)
    前端之jQuery
    JavaScript概述
    前端CSS
    前端HTML
    WIN10下Mysql安装使用
    python 创建线程
    Python 创建进程
    python day24模块
    python常用模块2(序列化,pickle,shelve,json,configparser)
  • 原文地址:https://www.cnblogs.com/liaoliao/p/5136765.html
Copyright © 2011-2022 走看看