So basically I have 2 tables one is customer and the other one is department both of them have a common attribute, 'branch'.

I was trying to fetch the department\_manager(from department table)
and customer\_name(from customer table)

So my query was 

```
     SELECT department_manager,customername FROM customer,department WHERE 
 customer.branch=department.branch;

```

This gives me the desired solution.

But then I thought of getting the same result using a subquery

```
    SELECT department_manager,customername FROM customer,department      WHERE 
 customer.branch IN ( select branch from department);

```

This is not giving me the desired solution as the first one was giving me. I basically want to join the two tables if they involve the common attribute ie the branch.