X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A7CCED1B502 for ; Wed, 12 Nov 2003 23:21:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 95672-01 for ; Wed, 12 Nov 2003 19:20:38 -0400 (AST) Received: from ns.lanterm.net (unknown [208.187.178.11]) by svr1.postgresql.org (Postfix) with ESMTP id 89D7CD1B53F for ; Wed, 12 Nov 2003 19:20:01 -0400 (AST) Received: from Louise ([208.187.178.2]) by ns.lanterm.net (8.11.6/8.11.6) with ESMTP id hACLwks09068; Wed, 12 Nov 2003 14:58:46 -0700 From: "Louise Cofield" To: "'George Weaver'" , Subject: Re: Looks are important Date: Wed, 12 Nov 2003 16:19:43 -0700 Message-ID: <003a01c3a973$743eed00$7801a8c0@Louise> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_003B_01C3A938.C7E01500" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: <00ac01c3a96a$a165b290$6400a8c0@Dell4500> Importance: Normal X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/145 X-Sequence-Number: 15960 This is a multi-part message in MIME format. ------=_NextPart_000_003B_01C3A938.C7E01500 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Try the TRIM function or the LTRIM function: SELECT RPAD(no,30,' ') || TRIM(tableb.kind) FROM tablea WHERE tablea.kind = tableb.kind Louise -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of George Weaver Sent: Wednesday, November 12, 2003 3:12 PM To: pgsql-sql@postgresql.org Subject: [SQL] Looks are important Hi Everyone, I am trying to concatenate two fields through a query: SELECT RPAD(no,30,' ') || tableb.kind FROM tablea WHERE tablea.kind = tableb.kind The result gives (for example): 4595448 Green 5966 Yellow 106-60033 Green 15-94-387 Red 217-991173 Blue What I would like to have is better alignment: 4595448 Green 5966 Yellow 106-60033 Green 15-94-387 Red 217-991173 Blue Is there some kind of encoding or other string options that will result in better alignment than what I've tried with Rpad? Thanks in advance, George ------=_NextPart_000_003B_01C3A938.C7E01500 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Message
Try the TRIM funct= ion or=20 the LTRIM function:
&nbs= p;
SELECT RPAD(no,30,' ') || TRIM(tableb.kind) FROM = tablea 
WHERE tablea.kind =3D tableb.kind
 
Louise
-----Original Message-----
From:=20 pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On=20 Behalf Of George Weaver
Sent: Wednesday, November 12, 2003 = 3:12=20 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] Looks = are=20 important

Hi Everyone,
 
I am trying to concatenate two fields th= rough a=20 query:
 
SELECT=20 RPAD(no,30,' ') || tableb.kind FROM = ;tablea 
WHERE=20 tablea.kind =3D tableb.kind
 
The result gives (for=20 example):
 
4595448         &nb= sp;            = =20 Green
5966          =             &nb= sp;  =20 Yellow
106-60033         =            =20 Green
15-94-387         &= nbsp;          =20 Red
217-991173         &n= bsp;         =20 Blue
 
What I would like to have= is better=20 alignment:
 
4595448         &nb= sp;           Green<= BR>5966           &n= bsp;            = ; =20 Yellow
106-60033         =          Green
15-94-387&nb= sp;            =       Red
217-991173   &nbs= p;            &= nbsp;Blue
 
Is there some kind of encoding or other = string=20 options that will result in better alignment than what I've tried with=20 Rpad?
 
Thanks in advance,
George
 
 
 
 
------=_NextPart_000_003B_01C3A938.C7E01500--