1.一个有年月日的字段,只取年和月
CONVERT(VARCHAR(7),字段,111)
2.计算两个日期的天数
DATADIFF()
3.取分组后的第一条纪录。
SELECT * ,ROW_NUMBER() OVER(PARTITION BY *** ORDER BY ***) AS SEQ_ID
WHERE SEQ_ID = '1'
指键之吻
No man or woman is worth your tears, and the one who is, won‘t make you cry. |
|
|