I have data set as a varchar(500), but I only know if it's numeric or character.
I need to count the max spaces of the length of a column AND the max spaces after a decimal point.
For Example:
ColumnA
1234.56789
123.4567890
would return 11 spaces total AND 7 spaces after the decimal.
It can be two separate queries.
If a value has no decimal, the above will return -1 for the spaces after decimal, so you could use:
Demo of both: SQL Fiddle
If you just wanted the
MAX()
then you'd just wrap the above inMAX()
: