zoukankan      html  css  js  c++  java
  • sql 常用语句

    #查询
    select * from t_user where id=1;
    关联查询
    select * from a left join b on a.id=b.id;
    select * from a right join b on a.id=b.id;
    select * from a inner join b on a.id=b.id;
    
    #union结果集合用
    select id,name from a where id=3
    union
    select id,name from b where id=4;
    #嵌套
    select * from (select * from b) where name='linux'l;
    select * from t_user where id in (select id from t_id);
    select * from t_user where (id,name) in (select id,name from t_id);
    #having二次筛选
    select * from t_user where id =4 group by name having count(name)>3;
    #between
    select * from t_user where id between 1 and 10;
  • 相关阅读:
    笔记
    Dwarf Tower
    第k小数
    np
    noi 抓住那头牛
    HDU 1575 Try A
    acm 易错警示
    E
    魔改森林 题解(dp+容斥+组合数学)
    F. Unusual Matrix 题解(思维)
  • 原文地址:https://www.cnblogs.com/anhao-world/p/14821093.html
Copyright © 2011-2022 走看看