日期:2014-05-18  浏览次数:20392 次

请各位老大支招一简单查询
我有一张表:
col1             col2                   col3
a                       1                       word
a                       2                       excel
a                       3                       ppt
a                       4                       windows
b                       1                       word
b                       2                       excel
b                       3                       windows
b                       4                       server
b                       5                       ppt
c                       1                       excel
c                       2                       word
c                       3                       server
c                       4                       ppt
c                       5                       excel
.............................

各位老大,     我的意思是从a,b,c看一下第三列出现的顺序,找出一个大致的趋势,就是这些东西怎么排列的,从前到后用频率排一下,谢谢各位老大,在线等,急急急!

------解决方案--------------------
col1 col2 col3
a 1 word
a 2 excel
a 3 ppt
a 4 windows

估计是查col3的排列规则,又是一个比较智能化的东西,难搞.帮顶.
------解决方案--------------------
declare @t table(col1 varchar(2),col2 int,col3 varchar(16))
insert into @t select
'a ', 1, 'word ' union all select
'a ', 2, 'excel ' union all select
'a ', 3, 'ppt ' union all select
'a ', 4, 'windows ' union all select
'b ', 1, 'word ' union all select
'b ', 2, 'excel ' union all select
'b ', 3, 'windows ' union all s