Home  >  Article  >  Backend Development  >  一条SQL语句怎么求环比!这个月简历数减去上个月的(如图)

一条SQL语句怎么求环比!这个月简历数减去上个月的(如图)

WBOY
WBOYOriginal
2016-06-13 12:39:561746browse

一条SQL语句如何求环比!这个月简历数减去上个月的(如图)

【这个月简历数】-【上个月的简历数】=【环比数】(如图)

sql语句如何写?
SELECT DATE_FORMAT(m_adddate,'%m')  as month,count(m_id) as zong,DATE_FORMAT(m_adddate,'%Y') as year from job_myreceive where DATE_FORMAT(m_adddate,'%Y')=2011  GROUP BY DATE_FORMAT(m_adddate,'%m');

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