-
Modified
we have a table structure like this
name code
a xYZ | MNO
b XYZ | MNO
i want an output like this
name code
a XYZ
a MNO
b XYZ
b MNO
how to achieve this in SQL Server 2000
-
use tempdb
create table x124 (name varchar(10), code varchar(100))
insert into x124 select 'a', 'xYZ | MNO'
insert into x124 select 'b', 'XYZ | MNO'
select name, left(code,charindex('|',code,1)) as Code
from x124
union
select name, right(code,len(code)-charindex('|',code,1)-1) as Code
from x124
-
s'ry
thx for u r answer
but i'm sorry for posting the half part of my requirement
we have a table structure like this
name code
a XYZ | MNO
b XYZ | MNO | PQR
c XYZ
i want an output like this
name code
a XYZ
a MNO
b XYZ
b MNO
b PQR
c XYZ
in the code column,there may be n number of items seprated by |
thanks once again
PL'z help me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|