My situation, I have:
id name
1 jack S
1 jack Soon
1 jack Son
2 Ray J
2 Ray James Charles
2 Ray J C
3 Mark
I need to select only one ID with the longer name, or at lesat only one name. Result something like:
id name
1 jack Soon
2 Ray James Charles
3 Mark
in SQL I would do something like:
select id,
max(name) keep (dense_rank first order by length(name) desc) from t
group by id;
But the table is already loaded in qliview from the database, how would I create a new table with that statement?