I have two tables tab1 and tab2.

```
create table tab1 ( emp_id number(2), salary number(4));

insert into tab1 values(1,2000); 
insert into tab1 values(2,3000); 
insert into tab1 values(3,3645); 
insert into tab1 values(4,2143); 
insert into tab1 values(5,2541);

create table tab2( emp_id number(2), first_name varchar2(20), gender varchar2(10) );

insert into tab2 values(1,'aaaa','male'); 
insert into tab2 values(2,'bbbb','female'); 
insert into tab2 values(3,'cccc','male'); 
insert into tab2 values(4,'dddd','female'); 
insert into tab2 values(5,'eeee','male');

```

I can get only gender and maximum salary column with this query, but I want to see also emp\_id and first\_name columns as a result. Here is my query...

```
select m.gender,max(h.salary) 
  from tab2 m 
  join tab1 h 
    on m.emp_id=h.emp_id 
 group by m.gender;

```