Re: Formatting Function..

Поиск
Список
Период
Сортировка
От Andrew Bartley
Тема Re: Formatting Function..
Дата
Msg-id CAEAIPJHMAFOJGDANDACMEGOEOAA.abartley@evolvosystems.com
обсуждение исходный текст
Ответ на Re: Formatting Function..  (mike g <mike@thegodshalls.com>)
Ответы Re: Formatting Function..  (Vinay Jain <vinayjain@gmail.com>)
Список pgsql-general
To format the column names you could try

select cast(name as char(desired length)) as "Name", age as "Age" from
student;

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of mike g
Sent: Monday, 5 July 2004 3:44 PM
To: Vinay Jain
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Formatting Function..


Perhaps,

select cast(name as varchar(desired length)) as name, age from student;

Mike
On Mon, 2004-07-05 at 00:19, Vinay Jain wrote:
> Hi..
> I am newbe in postgresql so please help me though the question may be
> very easy to answer..
> Is there any formatting function to get output with fix lengths..for
> example my query is..
> schema is:
>
> Student
> (name Varchar,
> age integer);
>
> select name, age from student;
> the output is like this..
> Name                                      | Age
> xyz                                          | 22
>
> I want this length of name to be of my choice...is it possible..& how..
>
> thanks in advance
> Regards
> Vinay
>

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html




В списке pgsql-general по дате отправления:

Предыдущее
От: mike g
Дата:
Сообщение: Re: Formatting Function..
Следующее
От: Vinay Jain
Дата:
Сообщение: Re: Formatting Function..