Lets say i have a table like this:
col1 col2 col3
row1 1 null null
row2 null 2 null
row3 null null 3
All data types are numbers, integers or long. And i need a table like this:
col1 col2 col3
row1 1 2 3
How can i accomplish this with an sql statement? I assume i have to create a new table and insert a new row with a select statement, but i am more of a coder and not sure what kind of statement i should use. Thanks for the help.
sllev got me on the right track. In my case, because all values except for one were always going to be null in any given column, i just had to use the MAX() function. my final sql statement looked like this:
Simple, i know, but i dident see it right away. Thank you to everyone who contributed a response, and to sllev who pointed me in the right direction.