Removing blanks from ouput format ? 
Author Message
 Removing blanks from ouput format ?

Hi all,
is there a way to discard the blanks filling a column in SELECT ?
I wish I could have

select * form T1

A B C
------ -------- ------
1 2 3
4 50 7
a b cd

instead of:

select * form T1

A      B        C
------ -------- ------
10     2        3
4      50       7
a      b        cd

thank you in advance !

Pierre

Sent via Deja.com http://www.***.com/
Before you buy.



Tue, 21 Jan 2003 03:00:00 GMT
 Removing blanks from ouput format ?

As long as it doesn't exceed 255 characters, and assuming varchars, you
could do the select like this:

select a+" "+b+" "+c as "A B C" from T1.

If the columns are char types:

select rtrim(a)+" "+rtrim(b)+" "+rtrim(c) from T1

-bret

Quote:

> Hi all,
> is there a way to discard the blanks filling a column in SELECT ?
> I wish I could have

> select * form T1

> A B C
> ------ -------- ------
> 1 2 3
> 4 50 7
> a b cd

> instead of:

> select * form T1

> A      B        C
> ------ -------- ------
> 10     2        3
> 4      50       7
> a      b        cd



Tue, 21 Jan 2003 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Formatting Ouput - Select Statement

2. removing blanks

3. Remove blanks in fields

4. How to remove trailing blanks from data

5. Removing trailing blanks

6. Removing trailing blanks from a column

7. Removing blank spaces

8. How to remove blanks or spaces from output

9. Remove blank records from result

10. Export varchar to text file - need to remove trailing blanks

11. removes multiple blanks from a character string

12. Removing blank spaces from a column ?


 
Powered by phpBB® Forum Software