warning: Creating default object from empty value in /home/skyontech/www/www/blog/modules/taxonomy/taxonomy.pages.inc on line 34.

Escaping wildcard characters % and _ in SQL

It seems like an obvious question, but when someone on an IBM developerWorks forum asked how to use wildcards as literals in SQL I realized I didn't know the answer off hand! How DO you find all the records with a part number that contains an underscore, say? SELECT * FROM partno WHERE part LIKE '%_%' doesn't work as we'd like!

Syndicate content