場景:
我有一個sql: SELECT id ,status FROM table_name WHERE status <> 4
此時查詢報錯:ORA-01722: 無效數字,可判斷是 數據庫中status 這列有髒數據了(字符串)
解決方法: SELECT id ,status FROM engineer_maintenance_plan WHERE regexp_replace(status,'\d',null) is not null
用這個sql 把 數字替換成 null ,然後把不能替換的數據給查詢出來