Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Kathy writes "Can any one please help me in creating queryActual Data in databaseID Name Award Note91 Maxine Ace Award Give on date 23rd February.91 Maxine Ace Award Give on date 27th January.91 Maxine Meal Voucher Give on date 5th June.91 Maxine Meal Voucher Give on date 8th August.92 Collette Ace Award Give on date 2nd January.92 Collette Ace Award Give on date 3rd March.92 Collette Ace Award Give on date 5th July92 Collette Ace Award Give on date 9 April92 Collette Meal Voucher Give on date 8th November.92 Collette Meal Voucher Give on date 7th June.92 Collette Meal Voucher Give on date 4th July.Required DataID Name Award No of Times Note91 Maxine Ace Award 2 Give on date 23rd February.Give on date 27th January.91 Maxine Meal Voucher 2 Give on date 5th June.Give on date 8th August.92 Collette Ace Award 3 Give on date 2nd January.Give on date 3rd March.Give on date 5th July92 Collette Meal Voucher 3 Give on date 8th November.Give on date 7th June.Give on date 4th July.Thanks,"
khtan
In (Som, Ni, Yak)
17689 Posts
Posted - 2006-08-08 : 09:18:40
something like
select ID, Name, Award, count(*) as [No of Times], <concatenate the Note >from tablegroup by ID, Name, Award
and refer to here on how to concate the Note in rows to columnKH