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.
Author |
Topic |
froggy
Starting Member
14 Posts |
Posted - 2006-11-21 : 03:07:08
|
Hi,i have a database containing employees' information. Each employee will belong to one division, one department and up to 3 sections.My tables are named div, dept, sect, sectII, sectIII.In my report, i would like to see the employee contact numbers group according to the sections. As such, should one employee belong to 3 sections, his information will appear thrice in the different sections.Eg.Section/Role | Name | Mobile No--------------------------SportsPlayer1 | Michael | 1234567Player2 | Tammy | 2345678--------------------------ArtsPlayer1 | Michael | 1234567Player3 | Nicholas | 3456789---------------------------LanguagePlayer1 | Michael | 1234567Player4 | Evelyn | 7654321 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-21 : 03:11:48
|
How a bout posting some DDL for the tables? And the sample data you used to produce the expected output above?Peter LarssonHelsingborg, Sweden |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-21 : 03:20:27
|
I think what you want is UNION ALL operator.Peter LarssonHelsingborg, Sweden |
|
|
|
|
|