Mehdi Ali Akbari :
ID col1 col2 col3
------------------------
1 A null null
1 null B null
1 null null C
2 D null null
2 null E null
2 null null F
From this table, remove null value and merge rows base on ID
ID col1 col2 col3
------------------------
1 A B C
2 D E F
a_horse_with_no_name :
You can use aggregation for that, as aggregate functions ignore NULL values:
select id,
max(col1) as col1,
max(col2) as col2,
max(col3) as col3
from the_table
group by id
order by id;
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=398158&siteId=1