zoukankan      html  css  js  c++  java
  • SQL语法

    select 列名称 from 表名称
    select * from 表名称

    insert into 表名称 values ('1','2','3',...) 插入新的行
    insert into 表名称 (列1,列2,...) values ('1','2','3',...) 指定所要插入数据的列

    insert into 表名称 select * from 表名称 //从其他表添加数据

    alter table 表名称 add 列名称 datatype //增加列


    update 表名称 set 列名称 = '新值' where 列名称 = '某值'
    修改数据


    delete from 表名称 where 列名称 = '值' //删除行

    delete from 表名称 //删除所有行

    alter table 表名称 drop column 列名称 //删除列 删除列之前该列所有的索引和约束必须首先删除

    truncate table 表名称 //删除整个表
    drop table 表名称 //删除表

    drop datebase 数据库名称 //删除数据库

    select 列名称 from 表名称 where 列 运算符 '值'
    条件选择

    select * from Persons where FirstName = 'Thoms' and LastName = 'Carter'

    and or


    select ID from Students order by student asc

    order by 排序(默认升序)
    asc 升序
    desc 降序排序

  • 相关阅读:
    C#泛型
    Chrome 中调试Javascript
    Oracle分页查询语句
    WordCount2.2
    第一周博客作业
    WordCount--统计输入文件的字符数、行数、单词数(java)--初级功能
    PHP数据库操作
    PHP安全函数
    PHP基础
    用户/目录操作
  • 原文地址:https://www.cnblogs.com/xslwm/p/9802867.html
Copyright © 2011-2022 走看看