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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Master detail table problem

Author  Topic 

ismile
Starting Member

1 Post

Posted - 2009-07-07 : 08:04:57
Hi I need your valuable help
I have 2 table one have studen number other have student number and non attened date. I would like to insert second table mached values into unattanded dates field side by side into final table

first table
student no
1
2
3

second table
student no unattanded date
1 01.01.2009
1 03.01.2009
1 04.01.2009
3 05.05.2008
3 06.04.2009
3 01.01.2009
2 10.10.2009
2 20.10.2009

final table should be like this
studen_no un_attandeddays
1 01.01.2009,03.01.2009,04.01.2009
2 10.10.2009,20.10.2009
3 05.05.2008,06.04.2009,01.01.2009








RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-07-07 : 08:09:56
Have a look at PIVOT in Books Online.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-07 : 08:15:47
the dates are comma separated value as a single column un_attandeddays ?

use this method : concatenate records without UDF


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -