sql - Db2 - How to return the condition value if the condition is failed? -


assume there column in table.

name  add xxx   yyy yyy   zzz 

i need search if name column contains name 'aaa' if not return aaa.

could 1 please me in achieving this.

you can use uion

select name tab name = 'aaa' union select 'aaa' 

union elimnates duplicates if 1st query return aaa won't repetaed


Comments