chrisdoesstuff
Technical User
I am trying to write a query that will end up on a crystal report. SQL 2005 and this will be part of a stored procedure.
I have a basically 1 table that contains two rows which have all my information in them but I need to be able to alias the column based on the values contained in a way where they each come out in their own column (field).
Example mytable.findingname, mytable.findingvalue
I have 125 values in this table that need to become 125 separate items for formatting reasons. There is a web based application that is formatted a certain way and the report needs to mimic it.
So instead of findingvalue I would like
findingvalue1 findingvalue1a findingvalue1b findingvalue1c
findingvalue2 findingvalue2a findingvalue2b findingvalue2c
returned in a single row from my query.
findingvalue1 = 'value_abc'
findingvalue1a ='value_abca
findingvalue1b= 'value_abcb'
The 125 values are preset and already known. Temp tables/ table variables are fine. I'll take any feedback you can provide.
I have a basically 1 table that contains two rows which have all my information in them but I need to be able to alias the column based on the values contained in a way where they each come out in their own column (field).
Example mytable.findingname, mytable.findingvalue
I have 125 values in this table that need to become 125 separate items for formatting reasons. There is a web based application that is formatted a certain way and the report needs to mimic it.
So instead of findingvalue I would like
findingvalue1 findingvalue1a findingvalue1b findingvalue1c
findingvalue2 findingvalue2a findingvalue2b findingvalue2c
returned in a single row from my query.
findingvalue1 = 'value_abc'
findingvalue1a ='value_abca
findingvalue1b= 'value_abcb'
The 125 values are preset and already known. Temp tables/ table variables are fine. I'll take any feedback you can provide.