**GOAL**

I simply want to select the details of those employees having salary greater then the HCL(company-employe).

[![Tables ](https://i.stack.imgur.com/SeGKs.png)](https://i.stack.imgur.com/SeGKs.png)

**What I've tried :**

```
SELECT Emp.emp_id, Emp.Emp_name, Department.dept_name, Emp.Salary, Company.company_name from emp 
 JOIN department ON(emp.emp_id=department.emp_id) 
  JOIN company ON(department.dept_id=company.dept_id) 
   where emp.salary > (SELECT Emp.Salary FROM emp where Company.company_name='HCL');

```

**Problem :**

When I'm executing this query it shows : **Error Code: 1242. Subquery returns more than 1 row :**

**To remove the above error, I've tried :**

```
SELECT Emp.emp_id, Emp.Emp_name, Department.dept_name, Emp.Salary, Company.company_name from emp 
     JOIN department ON(emp.emp_id=department.emp_id) 
      JOIN company ON(department.dept_id=company.dept_id) 
       where emp.salary > (SELECT Emp.Salary FROM emp where Company.company_name='HCL' LIMIT 1);

```

I know that by providing *LIMIT* to the query it doesn't provides the desired output but it removes the Subquery returns more than 1 row error and when i executed this query it provides blanks rows and column at the output.

So anyone can help me where and what i am lacking in the query to select the desired details..