April 8, 2013 at 4:07 pm
Hi,
Can any one help me please
How to split single row into multiple lines (Not rows)
Thanks
Grace
April 8, 2013 at 4:10 pm
Not sure what you mean by this, can you please provide examples
April 8, 2013 at 4:11 pm
You could use CHAR(10) or CHAR(13) (depending on the output).
Could you give an example on what you're trying to do? or explain more the reason to have several lines?
April 8, 2013 at 5:38 pm
For Exp: I have the row data lengthy like "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
I need to display that data in Card in Power View, I able display as it is
but I need like aaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
Doesn't matter after how many char it will split, Just I need to split row data into multiple lines.
Thanks
Grace
April 8, 2013 at 5:38 pm
For Exp: I have the row data lengthy like "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
I need to display that data in Card in Power View, I able display as it is
but I need like aaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
Doesn't matter after how many char it will split, Just I need to split row data into multiple lines.
Thanks
Grace
April 8, 2013 at 5:50 pm
Something like this?
WITH Sample_Data AS(SELECT 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' string)
SELECT SUBSTRING( string, 1, 10) + CHAR( 10) +
SUBSTRING( string, 11, 10) + CHAR( 10) +
SUBSTRING( string, 21, 10) + CHAR( 10) +
SUBSTRING( string, 31, 10) + CHAR( 10) +
SUBSTRING( string, 41, 10) + CHAR( 10) +
SUBSTRING( string, 51, 10) + CHAR( 10) +
SUBSTRING( string, 61, 10) + CHAR( 10) +
SUBSTRING( string, 71, 10) + CHAR( 10) +
SUBSTRING( string, 81, 10) + CHAR( 10) AS multiple_lines
FROM Sample_Data
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply