I've got some scenarios where the first and last name is NULL. I'm assuming, because of the way I've got things grouped, that is why I get some extra rows.
I say "extra rows," because when I eliminate the first and last name criteria, I get 13 rows. When I ask for first and last name, I get 18. The extra rows seem to be coming from those situations where the first and last names are blank. Take a look:
I need to qualify the "patientname" somehow. Basically, I need the SELECT to go through every encountercode and grab the first name and the last name that isn't empty and not establish a new grouping based on an empty column.
How would I do that?