1
Note the result below:
This is the result of the following query:
select *,
isnull(h,isnull(f,isnull(d,isnull(b,isnull(a,0))))) as y1,
isnull(h,isnull(g,isnull(f,isnull(e,isnull(d,isnull(c,isnull(c,0))))))) as y2 from valor
My difficulty is: whenever y2
present a value of a column, y1
should always display the previous one, as is happening in line 2 of the above image.
But looking at line 1 is a case, line 3 another case and wrong cases than I wish to do.
Will anyone help me to assemble this query?
I edited the answer. Check now.
– Marcelo Shiniti Uchimura