mysql的一些常规操作

1.select count(*) from table;返回表记录数

2.insert into table(value1,value2) values(v1,v2);插入指定字段

3.update table set value=var,value2=var2 where;

4.aleter table tablename DROP value;

5.alter table tablename add primary key(value);

6.describe tablename ;

7.truncate table tablename

8.create table tablename(
value1 varchar(20) not null primary key,
value2 varchar(10)
);

9.alter table tablename add status varchar(400);

10.SELECT value1,count(*) as countvalue1  FROM tablename group by value1 order by countvalue1  DESC;查询某一字段并计数(重复),降序排列,返回

11.ALTER TABLE tablename MODIFY COLUMN value1 VARCHAR(200);

12.DELETE FROM tablename where ;

13.update tablename set value1=value1+"1"   字段+1

14.update tablename set value1=concat(value1,"")  字段添加内容

你可能感兴趣的:(mysql,mysql)