• SQL基本语句

    #重命名表 rename table 表名 to animals; 或者 alter table 表名 rename 表的新名字 #删除一列 alter table 表名 drop column des; #增加一列 alter table 表名 add des char(100) null [after 列名]; #改变列属性 第一种:alter table 表名 modify 需修改的列名 修改后的属性; 第二种:alter table 表名 change 需要修改的列名 修改后的列信息; 例如,表名:pet 属性:weight 改变weight的类型:    alter table pet change weight weight varchar(30);            改变weight的名字为wei:    alter table pet change weight  wei; #删除某一条记录(行)     delete from 表名 [where 条件] [order by 列名] [Limit 删除的行数rowNum];     删除满足条件的按列名排序后的所有记录的第rowNum行 #排序     select 列名 from 表名 order by 列名 [desc(降序)] [limit 起始检索行,检索行数] #保留数据位数

    0
    211
    22KB
    2014-08-05
    19
关注 私信
上传资源赚积分or赚钱