Grouping the result of query – GROUP BY clause and HAVING clause

1)select name address and salary of employee according to their dept name

 

SQL> select fname,lname,address,salary,dname
  2  from employee e,department d
  3  where e.dno=d.dno
  4  group by dname,fname,lname,address,salary;

FNAME                LNAME                ADDRESS                  SALARY
-------------------- -------------------- -------------------- ----------
DNAME
--------------------
Varun                deva                 sediyapu puttur           15000
Accounts

pranav               naik                 vijay nagar mysore        14000
Marketing

Thilak               naik                 beliyoorkatte puttur      15000
Packing


FNAME                LNAME                ADDRESS                  SALARY
-------------------- -------------------- -------------------- ----------
DNAME
--------------------
prjwal               raj                  jp nagara banglore        14500
Transport