MySQL 常见用法汇总

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/heqiang525/article/details/85329507

1、<> 表示不等于

例:selcet * from sev_account(表名) where accountstate<>4

accountstate 是表sev_account某一字段,上面的意思是查询accountstate不等于4的所有行。

2、substr()函数,是截取数据库某一字段的一部分;

substr(string,a,b) 其中string为某一字段名,a是起始位置,b是截取长度

例:select * from sev_account where substr(cardid ,7,2)='01'

猜你喜欢

转载自blog.csdn.net/heqiang525/article/details/85329507