
September 19th, 2011, 01:07 PM
|
 |
Contributing User
|
|
|
|
The reason for this is because when you use Group By, you must include all select fields in the Group By.
Below will run but it probably won't produce the results you are trying to achieve.
Code:
select
MAX(cs.service_date),
cs.notes,
cs.applicant_id,
wr.program_code,
wr.last_name,
wr.first_name,
wr.region_code,
wr.status_cd
from cs
join wr on cs.applicant_id=wr.applicant_id
where wr.status_cd='AC'
group by cs.applicant_id,wr.program_code,wr.last_name,wr.first_name,wr.region_code,wr.status_cd
|