请教如何从存储为date格式的字段中直接取出这个字段的月和日(mysql)
比如有个birthday存储的是2013-01-18
通过查询条件可以查出来,但是能不能直接读出01或者18而非读出来之后再通过PHP处理?
------解决方案--------------------刚才的答案纠正下,birthday不需要加引号
也可以这样
select MONTH(birthday),DAYOFMONTH(birthday) from table where ...
我测试过了,这样是可以取得你想要的数据的
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn