zoukankan      html  css  js  c++  java
  • SQL Server 基础语句学习(二)

    1. Update   

    Update table_name Set column_name = value_new Where ...

    Tips: 更新多个值,用逗号分隔

    2. Delete

    Delete From table_name where ...

    Tips: 删除全部数据

    Delete From table_name

    3. Top

    Select top 3 * from table_name
    
    Select top 30 percent * from table_name

     4.通配符

    '%'   -  一个或多个字符

    '_'    -  一个字符

    '[abc]'  -  abc 中任意单字符

    '[^abc]' - 不在abc 中的任意单字符

    Tips:

    查询目标为null 时 用 IS Null

    Select * from table_name where column_name is Null

    查询目标为空值是用 ''

    Select * from table_name where column_name like ''

     5. In - 多个值,
         Between…And   - 之间的数值,文本或日期 

    Select * from table_name where column_name in (value1, value2)
    
    Select * from table_name where column_name between value1 and value2 order by column
    
    Select * from table_name where column_name not between value1 and value2

     6. Alias

    Tips: 表的alias

    Select column_name From table_name as alias_name

    列的alias

    Select column_name as alias_name from table_name
  • 相关阅读:
    av 1. Computer Abstractions and Technolog
    计算机组成与设计硬件/软件接口 (MIPS版)
    7. 我们的十个数字
    6.电报机与继电器qk
    六. Vue CLI详解
    五. Webpack详解
    四. 前端模块化
    一. Vue简介
    三. Vue组件化
    7. Git原理
  • 原文地址:https://www.cnblogs.com/endless-on/p/3184708.html
Copyright © 2011-2022 走看看