I have some records like below:
urutan | desc |
---|---|
1432 | AMAN032 - Gunting |
1433 | BENANG156 - Sikat Pintu |
1434 | Oli Bell One AT-D 20W40 |
1435 | Water Refill |
1436 | KABUR001 - Gosok Air |
1437 | Kabel Ties 20 Cm - 50 |
Based on the table above, i have two formats of string in field desc:
- the correct format, which are urutan 1432, 1433, 1436.
- the incorrect format, which are urutan 1434, 1435, 1437
as you can see, the correct format has format like this below:
AMAN032 - Gunting
then i split:
[AMAN][032] - [Gunting]
[a word][3 digits number][space][-][space][any words]
.
my goal is I want to SELECT all records which does not match the correct format using PosgreSQL REGEXP in WHERE Clause (in a condition I don't know which urutan). so the result from table above are urutan 1434, 1435, 1437.