Which WHERE clause could be used in the SELECT statement to get the required output?

You need to extract details of those products in the SALES table where the PROD_ID column contains
the string ‘_D123’.
Which WHERE clause could be used in the SELECT statement to get the required output?

You need to extract details of those products in the SALES table where the PROD_ID column contains
the string ‘_D123’.
Which WHERE clause could be used in the SELECT statement to get the required output?

A.
WHERE prod_id LIKE ‘%_D123%’ ESCAPE ‘_’

B.
WHERE prod_id LIKE ‘%\_D123%’ ESCAPE ‘\’

C.
WHERE prod_id LIKE ‘%_D123%’ ESCAPE ‘%_’

D.
WHERE prod_id LIKE ‘%_D123%’ ESCAPE ‘\_’



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Oscar Copado Silva

Oscar Copado Silva

I think you are having trouble with \(backslash) and |(pipe) characters

option B: WHERE prod_id LIKE ‘%\_D123%’ ESCAPE ‘\’
option D: WHERE prod_id LIKE ‘%\_D123%’ ESCAPE ‘\_’

Luis

Luis

Question incorrect, I must to be:

A.WHERE prod_id LIKE ‘%_D123%’ ESCAPE ‘_’
B.WHERE prod_id LIKE ‘%\_D123%’ ESCAPE ‘\’
C.WHERE prod_id LIKE ‘%_D123%’ ESCAPE ‘%_’
D.WHERE prod_id LIKE ‘%\_D123%’ ESCAPE ‘\_’
Answer: B

There is not default escape character on Oracle.

Oscar I see you on “Comunidad Oracle Hispana”. Regards. Luis.

admin

admin

Thank you very much. Fixed.

Oscar Copado Silva

Oscar Copado Silva

Yes I am on COH. Saludos.