Showing posts with label dev_descriptionfrom. Show all posts
Showing posts with label dev_descriptionfrom. Show all posts

Monday, March 19, 2012

Adding Rows Together in SQL (SQL Server 2000)

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?

Sunday, March 11, 2012

Adding Rows Together in SQL (SQL Server 2000)

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_descrip tion
aaaabbb4234234Pager
aaaabbb2342342Work
aaaabbb23434Home
aaaabbb23434Cell Phone
kkkccc234234Home
kkkccc23434Cell
We want the result should be as follows:
aaaa bbb4234234Pager2342342Work23434Home23434Cell Phone
kkk ccc234234Home23434Cell
Any ideas would be apprecaited.. we are using SQL Server 2000
Thanks
HOW TO: Rotate a Table in SQL Server
http://support.microsoft.com/default...74&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_descrip tion
>
> aaaabbb4234234Pager
> aaaabbb2342342Work
> aaaabbb23434Home
> aaaabbb23434Cell Phone
> kkkccc234234Home
> kkkccc23434Cell
> We want the result should be as follows:
> aaaa bbb4234234Pager2342342Work23434Home23434Cell Phone
> kkk ccc234234Home23434Cell
> 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?