zoukankan      html  css  js  c++  java
  • 第三件:mysql复杂语句

    连接查询

      -- inner join

      -- left join

      -- right join

      -- full join

    子查询

      -- where子句后

        标量子查询:返回结果 一列一行

          select * from student where c_id = (select id from class where c_name = '六年级一班');

        列子查询:返回结果 一列多行

          select * from student where c_id in (select id from class);

          select * from student where c_id =any (select id from class);

          select * from student where c_id =some (select id from class);

          select * from student where c_id =all (select id from class);  -- 无结果

        行子查询:返回结果 多列多行

          构造行元素(age,height)

          select * from student where (age,height) = (select max(age),max(height) from student);

      -- from子句后

        表子查询:返回结果当做二维表来使用

          select * from (select * from student order by height desc) as a group by c_id;

      -- exists子查询

        select * from student exists(select * from class where id = 3);

      

    生活就要逢山开路遇水搭桥,愿共勉!
  • 相关阅读:
    c#语音报时(含完整的声音资源文件).rar
    SQL 查看数据库表的容量大小
    c# 鼠标在控件上拖动 移动窗体 移动窗口
    C# winform 右下角弹出窗口结果
    Qt通用方法及类库8
    Qt通用方法及类库7
    Qt通用方法及类库6
    Qt通用方法及类库5
    Qt通用方法及类库4
    Qt通用方法及类库3
  • 原文地址:https://www.cnblogs.com/TianMu/p/7595798.html
Copyright © 2011-2022 走看看