Hi,

Could anyone please tell me how to apply conditions on columns whihc are not a part of 'group by' clause?

For example, I wish to filter out those sections wherein the eldest member of a family is a male and has the value 'M' in its gender field....

select section_no,max(age) as 'Maximum Age' from table1 group by section_no

I now wish to apply (where gender='M')

How to do this??

You mean wish to apply WHERE gender != 'M' right? So males are not included in the query?
select section_no,max(age) as 'Maximum Age' from table1 WHERE gender != 'M' group by section_no

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.