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

    基本语句

    select:  select * from tableName where condition and condition and ...

    insert:  insert into tableName(column1, column2, ...) values(value1, value2)

    delete:  delete from tableName where conditions

    update: update tableName set column1=value1, column2=value2, ... where conditions

    提升:

    模糊查询:  select * from tableName where column like '%value%'

    选择前N条记录:select top N * from tableName where condition and condition and ...

    统计: select count(*) from tableName where conditions

    排序:  select * from tableName where column1 like '%value%' order by column2, column3, ... desc(降序) asc(升序)

    求和:  select sum(column) as name from tableName

    平均:  select avg(column) as name from tableName

    最大值:  select max(column) as name from tableName

    最小值:  select min(column) as name from tableName

  • 相关阅读:
    Linux用户组管理及用户权限3
    MySQL预处理和事务
    MySQL-子查询和多表联查
    Mysql-分组和聚合函数
    LNMP搭建
    apache-虚拟主机配置
    Apache-重写
    apache配置文件详解
    vim使用
    php-curl_init函数
  • 原文地址:https://www.cnblogs.com/zqiang3/p/2709849.html
Copyright © 2011-2022 走看看