I didn't plan to address Head function today specially after listing Tail function couple of days ago. Well, if you want to return the very first, certain number of tuples in a set, Head would be very useful. Here is a sample script against ss2k5 AS sample Adventure Works olap database.
select
--HEAD( «Set»[, «Numeric Expression»] )
head(
[Product].[Product Categories].[Category]
,
2
)
on 0
from
[Adventure Works]
Happy Cubing,
ZULFIQAR SYED
Thank you. I just tried it and it works fine for me.
Posted by: MSSQL Query Analyzer | December 08, 2009 at 01:00 AM