having and where clause in sql example