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 

  • 相关阅读:
    高效的多维空间点索引算法 — Geohash 和 Google S2
    Geohash距离估算
    位图(BitMap)索引
    深入浅出空间索引:为什么需要空间索引
    harbor rest api 转graphql api
    ringojs java jar 集成使用
    ringojs 使用rp 包管理web 应用依赖
    ringojs 的包管理
    ringojs 基于jvm 的javascript 平台试用
    graphql cli 开发graphql api flow
  • 原文地址:https://www.cnblogs.com/testerjun/p/9791502.html
Copyright © 2011-2022 走看看