|
Posted by Greg D. Moore \(Strider\) on 07/31/06 11:44
"SakyMoto" <jeroen.tijsen@gmail.com> wrote in message
news:1154344089.525844.305540@s13g2000cwa.googlegroups.com...
> I hope someone can help me with my problem. I have searched the
> internet for days for a solution, but nothing i found seemed to work.
> The following is what i have now:
What version of SQL are you using?
SQL 2005 has a PIVOT commandbuilt in.
Otherwise you can google for some code examples of how to do it in SQL 2000
(it ain't overly pretty.)
>
> appartmentid code
> 100306 Wip
> 100306 Zandbak
> 100306 Glijbaan
> 100306 Klimrek
> 100306 Schommel
> 100321 Glijbaan
> 100321 Schommel
>
> This results are made with this query:
>
> select
> appartment.appartmentid,
> listvalue.code
> from appartment
> inner join appartmentlistvalue on appartmentlistvalue.appartmentid =
> appartment.appartmentid
> inner join listvalue on appartmentlistvalue.listvalueid =
> listvalue.listvalueid
>
> The following is what i need:
>
> 100306 Wip, Zandbak, Glijbaan, Klimrek, Schommel
> 100312 Glijbaan, Schommel
>
> As you can see is this example, not all appartments have the same
> number of results. Can anyone tell me if this is possible?
>
> Many thanks,
> Sakymoto
>
[Back to original message]
|