This sort of magic is done using an intellegent client like a VB flexigrid.
THe hard answer.. YOu could probably use recursive querys and temp tables to Massage the results, but you will probably be better put doing this at the client.
Try this query... do u have an identity field in this table.. if u have u can use that instead of join on the name and title, it will be more efficient...
SELECT
CASE (SELECT Count(Name) FROM TBL T1 WHERE T1.Title=T.Title AND T1.name <= T.Name)
When 1 Then Title
Else ''
END Title,Name FROM TBL T
GROUP BY TITLE,NAME
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.