注意空格

增加


INSERT INTO `order`(订单编号,日期,商家名称,配件编号,配件名称,单价,销量) values(?,?,?,?,?,?,?)



删除


delete from `order` where 订单编号=?




修改


update `order` set 日期=?,商家名称=?,配件编号=?,配件名称=?,单价=?,销量=?,订单金额=? where 订单编号=?




查询


SELECT * FROM `order` WHERE CONCAT(`订单编号`,`配件名称`,`配件编号`)LIKE %?%




查询某字段重复的数据

查询user表中,user_name字段值重复的数据及重复次数


select user_name,count(*) as count from user group by user_name having count>1;




查询出来的内容 排序


select * from `order` order by `订单编号`
select * from `order` order by `日期`
select * from `order` order by `单价`
select * from `order` order by `销量`
select * from `order` order by `订单金额`
select * from `order` order by `商家名称`
select * from `order` order by `配件编号`
select * from `order` order by `配件名称`




计算


UPDATE `order`SET `订单金额`=(`单价`*`销量`)