Ben Mearns
GIS and Data in PA
Tuesday, June 14, 2011
postgres max integer in an alphanumeric column
select max(to_number(substring(COLUMNNAME from '([0-9].*)'),'99999')) from TABLENAME
removes letters from a mixed column ... can be used for generating a new id
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment