sql - round a version in PostgreSQL -
i need round off version column , round() works decimal, doesn't works on 7.3.1
dbtype version ------------------------ postgresql 7.3.1 oracle 11.2.0.4.0 oracle 12.4.5
my desired output
postgresql 7 oracle 11 oracle 12
you convert array:
select dbtype, (string_to_array(version, '.'))[1] the_table
or use split_part:
select dbtype, split_part(version, '.', 1) the_table
Comments
Post a Comment