sql - CASE: WHEN column1 IS NULL THEN write column2 -


is possible show data column if checked column null?

for example:

  • columns: color, originalcolor
  • table: tablecolors [color, originalcolor]

    [w, b] [ , g] [b, y]

and

select case when color null "extract data originalcolor" tablecolors 

should following list: w, g, b

could looking coalesce? function return first non-null value.

select coalesce(`color`, `originalcolor`) `color` `tablecolors`; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -