How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?

If you take a look at get_terms() documentation it accepts search argument, which will perform LIKE match against term name and slug.

File not found.