Software Development Network>> SQL Server>> hopefully an easy one
I need to determine the top 20 most frequent occurences of a value in a specific field using SQL.
you mean something like this
use northwindselect top 20 customerid, count(customerid) as ordercount from ordersgroup by customeridorder by ordercount desc
This query is from SQL 2005;
select
from
inner
on
group
or something like this
Thank you very much for your response.
hopefully an easy one
sks04
you mean something like this
DanUp
This query is from SQL 2005;
select
top 20 c.system_type_idfrom
sys.all_columns cinner
join sys.systypes ston
c.system_type_id = st.xtypegroup
by system_type_idor something like this
select
top 20 st.[name]from
sys.all_columns cinner
join sys.systypes ston
c.system_type_id = st.xtypegroup
by st.[name]Itzik Paz
Thank you very much for your response.