hi all,

i am trying to query a table for most often inserted values and have stumbled into a roadblock. the query i have so far works as expected:

select top 20 field1, COUNT(field1) AS Expr1
FROM tbl1
GROUP BY field1
order by expr1 desc

the problem is that i would also like to return a second column that just so happens to be of text type. mssql2k will not accept a text type column in the group by clause and i have tried to cast it as a varchar with no luck. any thoughts?

tia, alex
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to