Dear friends,
We are trying to achieve the following. Please advice
select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
from tbl1 a, tbl2 b
where b.data_id = a.id
and b.data_id=314
group by a.lastname,a.firstname,b.dev_address,b.dev_description
aaaa bbb 4234234 Pager
aaaa bbb 2342342 Work
aaaa bbb 23434 Home
aaaa bbb 23434 Cell Phone
kkk ccc 234234 Home
kkk ccc 23434 Cell
We want the result should be as follows:
aaaa bbb 4234234 Pager 2342342 Work 23434 Hom
e 23434 Cell Phone
kkk ccc 234234 Home 23434 Cell
Any ideas would be apprecaited.. we are using SQL Server 2000
ThanksHOW TO: Rotate a Table in SQL Server
http://support.microsoft.com/defaul...574&Product=sql
AMB
"Info Request" wrote:
> Dear friends,
> We are trying to achieve the following. Please advice
>
> select a.Firstname,a.Lastname, b.Dev_address,b.dev_description
> from tbl1 a, tbl2 b
> where b.data_id = a.id
> and b.data_id=314
> group by a.lastname,a.firstname,b.dev_address,b.dev_description
>
> aaaa bbb 4234234 Pager
> aaaa bbb 2342342 Work
> aaaa bbb 23434 Home
> aaaa bbb 23434 Cell Phone
> kkk ccc 234234 Home
> kkk ccc 23434 Cell
> We want the result should be as follows:
> aaaa bbb 4234234 Pager 2342342 Work 23434 Hom
e 23434 Cell Phone
> kkk ccc 234234 Home 23434 Cell
> Any ideas would be apprecaited.. we are using SQL Server 2000
> Thanks
>|||Thanks a lot. This works great.|||Rotation works perfect as long as we have one work phone number, if we
have more than one work phone number then it breaks with "Subquery
returned more than 1 value" error message.
Any ideas?
No comments:
Post a Comment