Use the Oracle regular expression to select the sequence number in data entries. Abstract: Use the Oracle regular expression to select the sequence number in data entries for the latest project. In the seven-digit string, select the sequence number according to the following rules: 1. the sequence number cannot contain numbers 4, 2, and 7 from the right to the left. At least three identical numbers must appear, and the same number can only be one of 6, 8, or 9, such as 1235666. 3. Seven digits can show all the same numbers, such as 1111111, 2222222, 3333333, 5555555, 6666666, and 7777777. in Oracle 10 Gb, we can easily implement the above requirements, you can use one SQL statement as follows:
SELECT * FROM a WHERE REGEXP_LIKE (id, '[^ 4] {4} [6] {3, 6} $') OR REGEXP_LIKE (id, '[^ 4] {4} [8] {3, 6} $') OR REGEXP_LIKE (id, '[^ 4] {4} [9] {3, 6} $ ') OR REGEXP_LIKE (id, '^ ([0-35-9]) \ 1 {6} $ ');