Search Postgresql Archives

Re: Conversion of string to int using digits at beginning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sam,

Maybe something like:

 SELECT MAX(nullif(regexp_replace(test, '^([0-9]*).*$', E'\\1'),'')::INT);

Thank you.
This seems to work but is bit slow.

How to speed it up ?

Should I create index

CREATE INDEX test ON test ( nullif(regexp_replace(test, '^([0-9]*).*$', E'\\1'),'')::INT );

?

Andrus.

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux