mysql学习问题解决

1.字符串转时间格式函数: STR_TO_DATE('2017-10-19 16:47:00', '%Y-%m-%d %H:%i:%s')

oracle的为to_date

2.specified twice问题

遇到这问题:网上查找的解决方法

【错误内容】:Error Code: 1093. Table '表名' is specified twice, both as a target for 'UPDATE' and as a separate source for data

【错产生经过】:update t_test1 set col1= col1_value where val1 in(select val1 from t_test2 group by val1);

【解决办法】:update t_test1 set col1= col1_value where val1 in(select * from (select val1 from t_test2 group by val1) as T);

注意:经测试delete时,也存在这种情况

3.模糊查询测试中 特别测试的符号  % _ [

由于通配符的缘故,导致我们查询特殊字符“%”、“_”、“[”的语句不能正常实现,而把特殊字符用“[ ]”括起便可正常查询

参考:https://www.cnblogs.com/nxld/p/6120049.html

猜你喜欢

转载自www.cnblogs.com/shishibuwan/p/9764833.html