    select shipgrp,  CASE WHEN count(distinct flag) > 1 THEN 'Floor' ELSE string_agg(DISTINCT flag,', ') END from rlarp.cust_flag group by shipgrp
 -- select shipgrp,  dsm, flag from rlarp.cust_flag
