Skip to content
Advertisement

SQL to detect if one column contains another column

I try to query as following:

I need to detect if voucher contains REV and give flag on row level. I tried OVER PARTITION but with no success. Any ideas?

Advertisement

Answer

Use a CASE expression and EXISTS:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement