1

So I have like fields like:

  • Home Zip
  • Business Zip
  • Mailing Zip

How could I do something like this (match any field that has Zip):

SELECT ILIKE "%Zip"
FROM db_tbl
WHERE condition = 'foo'
Phill Pafford
  • 83,471
  • 91
  • 263
  • 383

2 Answers2

1

Here is a good answer to your question:

stackoverflow.com/questions/5274594/

To summarize, standard SQL doesn't quite support that functionality, but you can get it somewhat working with a little work.

hspain
  • 17,528
  • 5
  • 19
  • 31
0

You can't. You can chain multiple LIKE statements with an OR, but SQL deals with data and not metadata, so there is no shortcut to 'search any field with X string for blah' anywhere in the SQL specification (or any SQL derivative I have ever used).

Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32