Home > Blockchain >  check the records that whether includes date format or not
check the records that whether includes date format or not

Time:08-26

I have a column contains strings like 13.04.2021 / CC 45,00 , CCC 54,43 3.05.2021 or null records. and I want to trim dates and I need only others. For example we take 13.04.2021 / CC 45,00 records. I need only CC 45,00 string.

CodePudding user response:

If you only want to remove the dates from your strings and they are only in the pattern of dd.mm.yyyy, You can try below pattern -

SELECT REGEXP_REPLACE(STR, '(\d{1,2}\.\d{1,2}\.\d{4})', '')
  FROM YOUR_TABLE;

Demo.

  • Related