Hi to all,
I created following table
===================================================
create table man(id integer, name varchar(20), city varchar(20), age integer, dept integer)
===================================================
I want name and maximum age of person residing in 'mumbai'. I wrote following query, but got the error like 'can not include name with max() fuction since it is not the part of it and there is no GROUP BY clause'.
==================================================
SELECT name, MAX(age) FROM man where city='mumbai'
==================================================
It displays the age qhen I ran follo. query.
==================================================
SELECT MAX(age) FROM man where city='mumbai'.
=================================================
How can I get Both i.e. name and age.