ITeye博客

MySQL学习

tom_seed · 2014-11-25 11:35 · MySQL · 数据库 · Markdown

ignore into、replace into、into区别:http://blog.sina.com.cn/s/blog_76cd6de80100u8ry.html

 

mysql in exists比较:http://blog.csdn.net/ldl22847/article/details/7800572

 

MySQL字符串转换成日期:str_to_date('2014-12-02 23:32:10', '%Y-%c-%d %H:%i:%s')

 

**日期转换成字符串:**DATE_FORMAT(now(), '%Y-%c-%d %H:%i:%s')

参数说明:

%Y:代表4位的年份

%y:代表2为的年份

%m:代表月, 格式为(01……12)

%c:代表月, 格式为(1……12)

%d:代表月份中的天数,格式为(00……31)

%e:代表月份中的天数, 格式为(0……31)

%H:代表小时,格式为(00……23)

%k:代表 小时,格式为(0……23)

%h:代表小时,格式为(01……12)

%I:代表小时,格式为(01……12)

%l:代表小时,格式为(1……12)

%i:代表分钟, 格式为(00……59)

%s:秒

 

[Err] 1093 - You can't specify target table 's' for update in FROM clause

原因:在更新这个表和数据时又查询了它,而查询的数据又做了更新的条件。

解决方法:把要更新的几列数据查询出来做为一个第三方表,然后筛选更新。

参考信息:http://blog.csdn.net/yaerfeng/article/details/7876461

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。