Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Subquery question

$
0
0

Hello,

I'm new to sql server and I have this problem that I need to solve using only subquery. Database used = adventureworks2014.

Code :

Select
p.LastName,
p.FirstName

From Person.Person p
Where BusinessEntityID IN
(Select
 BusinessEntityID
From HumanResources.Employee E
Group by BusinessEntityID,JobTitle
Having sum(VacationHours)<1
)

My issue is that I need to generate lastname, first name, job title and Vacation hours. 

Could someone guide me in regards to how to proceed?

Thank you



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>