BTYPE SERV DESC1 DPH TA Home visit DPH TB Group visit DPH TC Parent visit DPH TD Special visit -DPH only MED TA Home visit MED TB Grp. visit MED TC Parent vis. OTH TA Home visit OTH TB Group visit OTH TC Parent visitDesired result:
SERV DESC1 TA Home visit TB Group visit (or Grp. visit) TC Parent visit (or Parent vis.) TD Special visit - DPH onlyOld query:
select serv, desc1; from dtparat; group by serv && works with ENGINEBEHAVIOR 70, not 90I can't include DESC1 in the GROUP BY clause as required by 90, because some of the values are spelled slightly differently, resulting in multiple lines for a given SERV value. I've tried various nested joins with a DISTINCT intermediate file with no luck, such as:
SELECT dtparat.serv, dtparat.desc1 ; FROM dtparat; RIGHT JOIN (select DISTINCT serv; FROM dtparat; GROUP BY serv) distserv; ON dtparat.serv = distserv.serv; ORDER BY dtparat.serv && gives too many recordsThere's gotta be a way to do this in one step (to use as a view). Any help would be much appreciated.