I am trying to create a query that returns a result set with a distinct (car) column based on another (data) column that is non-null.
In the example below, if there is a non-null value found in the data column then return the single instance with a value and if not, return the value with null and always maintain the distinctness of the first column.
let Car = datatable(car, data:string)
[
"mercedes", "fast",
"mercedes", null,
"tesla", null
"toyota", "good",
"sonata", null,
"sonata", null,
"sonata", "amazing"
];
So the desired output would be:
"mercedes", "fast",
"tesla", null,
"toyota", "good",
"sonata", "amazing",
Thanks!