有些东西没什么懒或偷。 像 mysql 的 order by 与 group by group by 只能至于 order by 之前否则出错。
在日期的应用上有一条SQL有点点小用。如: select a,b,max(`date`) from table group by a order by max(`date`) 其次 group by 后可跟 having 语句,同 select 的where 如果想显示楼主的结果。要分两部做。 1.得出 所有不同的 a 如: select DISTINCT a form talbe 2.用1中的集操作 如: select * from table where a in(1的a集) order by `date`
2007-02-26 15:19:05
对于auto_increment的表 group by 之后取max(`c`.`articleid`)就得到要取的articleid了,假设date是按id递增的