0

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??

2
Contributors
1
Reply
19
Views
3 Years
Discussion Span
Last Post by hericles
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.