On Mon, Feb 16, 2009 at 07:10:11AM -0800, Lennin Caro wrote:
> you can use the substring function, like this
>
> select 'test123',substring('test123' from '...$')
>
> this return '123'
Note that regexps are slower than substrings; as an example, I did:
SELECT COUNT(s) FROM (
SELECT 'test
> 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 post
On Mon, Feb 16, 2009 at 03:21:20PM +0700, hendra kusuma wrote:
> select right(column, number_of_character) from table
[..]
> 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
AFAIK, it's
Hello Hendra,
there is no function right(column, n-Chars), but you can use
substring(column-name from offset for num_chars) in combination with
char_length for getting the right-n-characters as f. e.:
select substring(column from (char_length(column) - 3) for 4) from table
Ludwig
>Dear all,