I have a table and in this table there are sometimes single or duplicate lines with 1 different attribute. This attribute is typically either null or with a value. How can I write a select statement to return all without duplicates and pick the data that has the value and where it doesnt, then return the attribute for null.
e.g.
ID SD FEED
0016 21AE GF-HF
0016 21AE null
0017 21BE FF-HF
0017 21BE null
0018 21CE CF-HF
0018 21CE null
0019 21DE null
0019 21DE null
Should return from the select statement: (no duplicates)
ID SD FEED
0016 21AE GF-HF
0017 21BE FF-HF
0018 21CE CF-HF
0019 21DE null
select id,sd,max(FEED) from yourtable group by id,sd