GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL

 Print  |  
Question:  how many columns can be in the group by clause



August 08, 2009 05:44:14 #8
 harit79   Member Since: November 2008    Total Comments: 4 

RE: how many columns can be in the group by clause
 
If we are using aggregate function in select clause then there should be one column in group by clause, Let me explain with the example.

Select max(sal),min(hire_date),ename, lastname
from emp
where lastname like '_a%'
group by ename;

So you have to use atleast one column (No aggregate funciton).
     

 

Back To Question