Looks are important

From: "George Weaver" <georgew1(at)mts(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Looks are important
Date: 2003-11-12 22:12:28
Message-ID: 00ac01c3a96a$a165b290$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Terence Kearns 2003-11-12 22:53:36 Re: Is there a more elegant way to write this query?...
Previous Message Jan Wieck 2003-11-12 21:17:46 Re: transaction processing after error in statement