mysql
Today is monday
学习备忘
展开
-
MySql 根据身份证号获取省份、年龄、性别
select IFNULL(year(curdate())-if(length(card_no)=18,substring(card_no,7,4),if(length(card_no)=15,concat('19',substring(card_no,7,2)),null)),0)FROM `user`原创 2017-09-28 18:08:38 · 8091 阅读 · 1 评论 -
MySQL check the manual that corresponds to your MySQL server version for the right syntax
MySQL check the manual that corresponds to your MySQL server version for the right syntax使用powerDesigner生成sql文件运行报错。查询得知是由于关键字冲突,仔细检查表字段,更改字段名即可。原创 2018-01-08 20:15:49 · 1020 阅读 · 0 评论 -
mysql 查询优化 in 和 not in
select title.id,title.`name` from title where title.id not in (select user_tag.tagid from user_tag )可以改为select title.id,title.`name`from title left join user_tag on user_tag.tagid = title.id ...原创 2018-03-29 14:52:57 · 2031 阅读 · 0 评论