1、字符转Decimal
CAST(column AS DECIMAL(9,2))
2、将计算结果取两位小数:
round(column, 2)
3、查询非空
select * from table_XX where id is not null;
4、连表update更新
update a inner join (select yy from b) c on a.id =c.id set a.xx = c.yy
5、创建主键
alter table class add unique index name_index (name);
参考: