摘要:
--查询分组最大值SELECT*FROM`myTable`WHERE`val`IN(SELECTMAX(`val`)FROM`myTable`GROUPBY`id`)ORDERBY`id`ASCLIMIT10--CAST转换数据类型,DATE_FORMAT控制时间格式,DATE_ADD做时间运算SELECTCAST(DATE_FORMAT(DATE_ADD(NOW(),INTERVAL-1DAY),'%Y%m%d')ASSIGNEDINTEGER)Code highlighting produced by Actipro CodeHighlighter (freeware)ht 阅读全文