MYSQL常用函数

1.Mysql字符串字段判断是否包含某个字符串FIND_IN_SET

SELECT * FROM qr_usercontacts WHERE
EXISTS(SELECT touristorder_ref_userids FROM qr_touristorder WHERE touristorder_id = 325
AND FIND_IN_SET(CAST(qr_usercontacts.contacts_id AS CHAR), touristorder_ref_userids) > 0)

2.Mysql自增ID起始值修改方法

alter table table1 add id int auto_increment primary key 自增字段,一定要设置为primary key.

原文地址:https://www.cnblogs.com/morpheusliu/p/6150160.html