Is it possible to implement fuzzy search occurrences?

You need to choose from the database all the incomplete entry.

Relatively speaking:
SELECT * FROM mytable where okpd2_code IN ('26.51.20')

Need to get all records that have more digits:
26.51.20.121
26.51.20.123
26.51.20.312
26.51.20.848

Inside IN can be a bunch of values. And it is necessary that everyone be treated in a similar way.

and so on. Is it possible to implement in Postgres? If so, how?
March 19th 20 at 08:36
1 answer
March 19th 20 at 08:38
as an option to use the regular season:
SELECT * FROM mytable where okpd2_code ~ '^(var1|var2|...|varN)'

for example
SELECT * FROM mytable where okpd2_code ~ '^(26\.51\.20\.|22\.55\.20\.)'

Find more questions by tags PostgreSQL