Archives of the TeradataForum
Message Posted: Tue, 23 Nov 2004 @ 14:03:17 GMT
Subj: | | Re: Help understanding the Like operator |
|
From: | | Geoffrey Rommel |
The other folks have answered your question, but just to spell out the details: the column names are stored in the data dictionary in char(30)
columns, so most of them will have trailing blanks. Also, the underscore must be escaped. You therefore need to write
WHERE columnname like '%!_ID %' escape '!'
which will work except for column names that are exactly 30 bytes long. If you have some of those, you can write
WHERE columnname like any ('%!_ID %', '%!_ID') escape '!'
which will work unless you have some column names that contain embedded blanks! If that's the case, heaven help you.
|