I have a query that works perfectly in Mysql but fails in MSSQL.

Can anyone please throw light on this issue and guide me on how to avoid this in the future?

select cust_name,cust_email from customer,cust_departments
where customer.cust_id=cust_departments.cust_id and
cust_departments.dept_id='1' and cust.notify_ticket='1' group by cust_departments.cust_id
The error thrown is Column 'cust_name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

What do I do?

Thanks and Regards,