Write a SELECT statement that returns the LastName and JobTitle of each employee with a jobtitle other than ‘Engineer’ that has a SalaryWage greater than that of the lowest paid employee with a JobTitle of engineer. This question is from Murachs SQL Server 2012 for developers (chapter 6 How to code subqueries). The only answer posted on this site previously included results that were < that of the lowest paid engineer. Solution Hi, You have not mentioned Tables Name and thier schema. So, i assumed here. SELECT LastName, JobTitle FROM Employe as e, Job as j where (j.JobTitle not like \'Engineer\' or j.SalaryWage < (select min(j1.SalaryWage) From Job j1)) and e.id = j.id .
Write a SELECT statement that returns the LastName and JobTitle of each employee with a jobtitle other than ‘Engineer’ that has a SalaryWage greater than that of the lowest paid employee with a JobTitle of engineer. This question is from Murachs SQL Server 2012 for developers (chapter 6 How to code subqueries). The only answer posted on this site previously included results that were < that of the lowest paid engineer. Solution Hi, You have not mentioned Tables Name and thier schema. So, i assumed here. SELECT LastName, JobTitle FROM Employe as e, Job as j where (j.JobTitle not like \'Engineer\' or j.SalaryWage < (select min(j1.SalaryWage) From Job j1)) and e.id = j.id .