摘要:
ifobject_id('[tb]') isnotnulldroptable[tb] go createtable[tb](名称 varchar(10),金额 int,标志 varchar(2),日期 varchar(30))--收入1 支出为2 insert[tb] select'a',100,'1','2009-11-23 13:45' unionall select'b',150,'2','2009-11-22 13:45'unionall select'c', 阅读全文
posted @ 2010-01-03 10:52
曾祥展
阅读(847)
评论(0)
推荐(0)
摘要:
--取出点击量最高的文章100篇,每个作者不超过5篇 selecttop100 id,title,tips,author from ( select*,cnt=row_number() over (partition by author orderby tips desc) from tb ) t where cnt 11 then substring(a.Phone, 3, 11) else a.Phone end=b.phone and b.cnt=1 阅读全文
posted @ 2010-01-03 10:50
曾祥展
阅读(1922)
评论(0)
推荐(0)

浙公网安备 33010602011771号