I have a table which contains a column having alphanumeric values which is stored as a string. I have multiple values in that column having values such as F4737
, 00Y778
, PP0098
, XXYYYZ
etc.
I want to extract values starting with a series of F and must have numeric values in that row. Alphanumeric column is the unique column having unique values but the rest of the columns contain duplicate values in my table.
Futhermore, once these values are extracted I would like to pick up the max value from the duplicate row,for eg:
Suppose I have F4737
and F4700
as a unique Alphanumeric row, then F4737
must be extracted from it.
I have written a query like this but the numeric values are not getting extracted from this query:
select max(Alplanumeric)
from Customers
where Alplanumeric '%[F0-9]%
or
select max(Alplanumeric)
from Customers
where Alplanumeric like '%[0-9]%'
and Alplanumeric like 'F%'**
I run the above query but I am only getting the F series if I remove the numeric part from the above query. How do I extract both, the F starting series as well as the numeric values included in that row?