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 2000 Forums
 Transact-SQL (2000)
 select Question

Author  Topic 

Gili
Starting Member

42 Posts

Posted - 2008-01-14 : 09:21:51
Hi ,

I have table in this structure:

ComplainNo | EmployeeName1 | EmployeeName2
1 | Arik | David

I need to create table whice take the data from the above table and it will look like this

ComplainNo | EmployeeName
1 | Arik
1 | David

Any idea??
Thanks .

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-01-14 : 09:24:24
[code]select ComplainNo, EmployeeName = EmployeeName1 from yourtable
union all
select ComplainNo, EmployeeName = EmployeeName2 from yourtable[/code]


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

Go to Top of Page

pootle_flump

1064 Posts

Posted - 2008-01-14 : 09:25:32
SELECT ComplainNo, EmployeeName = EmployeeName1
UNION ALL
SELECT ComplainNo, EmployeeName2
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2008-01-14 : 09:26:07
Refresh before posting you fool
Go to Top of Page

Gili
Starting Member

42 Posts

Posted - 2008-01-14 : 09:50:56
Tanks it works.
good day :-)
Go to Top of Page
   

- Advertisement -