//查询
select * from table1;
select * from table1 where id = 2 and name year = 18 and devid = 5; //显示全部信息
select id, year, devid from table1; //显示year devid id 3项
select * from(select * from table1 where devid = 4 and year = 17 order by id desc) as totle
//在括号中查询到的结果中进行查询 as 是为这个查询结果起一个新的名字totle
select * from(select * from table1 where devid = 4 and year = 17 order by id desc) as totle limit 1
//在括号中查询到的结果中进行查询 as 是为这个查询结果起一个新的名字totle 显示1行
//删除
delete from table1 where id = 5 order by year desc limit 3; // id 等于5的所有行 每次删除3行 按照year 降序排列的顺序
//插入
insert into table1 (id,devid,year)values(10,12,19) ;//插入数据
//更新
update table1 set id=10 where year = 18; //更新year 为18的 id为10;