zoukankan      html  css  js  c++  java
  • 数据库相关

    查询

     

     

     

    select 字段 from 数据表 where 条件 group by 分组依据 order by 排序依据;

      

    1、select DISTINCT amount from checks; ———在checks表中查找不重复的amount

     2、select xx ||xx  新xx from xx 连接—可以将两个字符串串连接起来

    3、select x from xx where xx like (not like) xx; 查询xx/不是xx

    4、select A from xxA UNION select A from xxB;——-查询2个表中不重复的字段(去掉重复)

    5、select A from xxA UNION ALL select A from xxB;—查询2个表中不重复的字段(不去掉重复)

    6、INTERSECT 相交

    INTERSECT 返回两个表中共有的⾏

    select * from xxA intersect select * from xxB;

     

    7、MINUS 相减

    存在第一个表中,但不存在第二个表中

    select * from xxA minus select * from xxB

     

    8、从属运算 IN and BETWEEN 

    SELECT * FROM FRIENDS WHERE STATE= 'CA' OR STATE ='CO' OR STATE = 'LA'       等价于  SELECT * FROM FRIENDS WHERE STATE IN('CA','CO','LA')

    SELECT * FROM PRICE WHERE WHOLESLE>0.25 AND  WHOLESE <0.75; 等价于  SELECT * FROM PRICE WHERE WHOLESALE BETWEEN 0.25 AND 0.75 

  • 相关阅读:
    【cocos2d-js公文】十七、事件分发机制
    UVA它11292
    定义自己的仪表板DashBoard
    ufldl学习笔记和编程作业:Feature Extraction Using Convolution,Pooling(卷积和汇集特征提取)
    互联网和移动互联网怎么赚钱?
    android布局margin和padding差异!
    解决ORA-28000: the account is locked
    网络编程基本知识
    10个优秀的 HTML5 &amp; CSS3 下拉菜单制作教程
    Codeforces554A:Kyoya and Photobooks
  • 原文地址:https://www.cnblogs.com/testerjun/p/9791502.html
Copyright © 2011-2022 走看看