Re: ask: select right(column) ???

From: Lennin Caro <lennin(dot)caro(at)yahoo(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>, hendra kusuma <penguinroad(at)gmail(dot)com>
Subject: Re: ask: select right(column) ???
Date: 2009-02-16 15:10:11
Message-ID: 58935.28086.qm@web59516.mail.ac4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> I have simple question
> I tried following code
>
> select right(column, number_of_character) from table
>
> but it didn't work, saying that pg doesn't have the
> function
> is there any way to achieve such output?
>
> honestly I have no idea that such simple feature
> doesn't exist in postgresql
> or am I wrong? since I look at SQL Key Words table and
> it's written as
> reserved
>
> Thank you
> Regards
> Hendra

you are right but you can use the substring function, like this

select 'test123',substring('test123' from '...$')

this return '123'

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-02-16 15:12:14 Re: idle DB and resources
Previous Message Serge Rielau 2009-02-16 14:13:04 Re: Which SQL is the best for servers?