ITeye博客

日志归档SQL写法

cetusz · 2009-11-24 15:07 · sql · 数据库 · Markdown

"select year(pubdate),month(pubdate),count(id) from News Group by year(pubdate),month(pubdate) order by year(pubdate) desc,month(pubdate) desc" 

 

access不支持when case end sql语法 但有iif()函数可以代替

如iif(test=1,'me',iif(test=2,'you','other')

相当于

case test when 1 then 'me' when 2 then 'you' else 'other' end from table

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。