QuestionQ250

VerifiedRestricting and Sorting Data

You need to retrieve details for products in the SALES table whose PROD_ID column contains the string _D123. Which WHERE clause can be used in the SELECT statement to produce the required output?

Explanation

In an Oracle LIKE condition, _ is a single-character wildcard. A literal underscore must be preceded by a valid escape character. With ESCAPE '\', the pattern '%\_D123%' treats \_ as a literal underscore and matches values containing _D123. The escape character must be a single character and cannot be % or _.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!