Home > Software design >  SQL Query For data valiadation
SQL Query For data valiadation

Time:06-26

I want to run a SQL query to get pay rates with .xx01, for example, These number with .xx01 only needs to be pulled.

$21.5401
12.5701
75.1701
54.1201

Note: this is for Oracle SQL Developer

CodePudding user response:

Use this REGEX pattern to identify matches:

For Oracle:

^[0-9]*\.[0-9][0-9]01$

SELECT test_number
FROM test_table
WHERE REGEXP_LIKE (test_number, '^[0-9]*\.[0-9][0-9]01$');

For MySQL:

SELECT test_number
FROM test_table
WHERE test_number RLIKE '^[0-9]*\.[0-9][0-9]01$';

CodePudding user response:

You can use this:

select column_name from table_name where column_name like '%.__01';

  • Related