文章分类 -  sql server

sql, sql server 2000
摘要:sql = "SELECT id, forum_id, topic, tim FROM bbs_topic ORDER BY forum_id, tim DESC COMPUTE count(id) BY forum_id" set rs = conn.execute(sql) While Not rs Is Nothing Do While Not rs.EOF response.wri... 阅读全文
posted @ 2006-01-04 17:21 pcvc 阅读(804) 评论(0) 推荐(0)
摘要:CASE 计算条件列表并返回多个可能结果表达式之一。 case有以下两种形式:SELECT top 50 id, '栏目' = CASE when forum_id = 1 then '以兰会友' when forum_id = 2 then '种养栏目' ELSE '其它栏目'end, substring(topic, 1, 13)FROM bbs_topic 等价于SELECT top ... 阅读全文
posted @ 2006-01-04 14:38 pcvc 阅读(1988) 评论(0) 推荐(0)