Home select (a or b) as c from table;
Reply: 0

select (a or b) as c from table;

user356
1#
user356 Published in July 18, 2018, 10:30 pm

Is there a way to select A if A column exists else select B column?

For a table

A    | B
-----|-----
foo  | bar
NULL | bar
foo  | NULL

Result would be

C
----
foo
bar
foo

It seems there's no function supporting this in docs.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311076 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO