sql join

Hi!

I have 2 tables

products
locationID ,ItemId ,,,,,
1                    10
2                     11
2                     12
2                      13

Assets
ItemId,,,
10
11
12
13
14 ,,,,

I need to get all assets from asset for a LocationId (locationId 2 should give from assets items 11,12,13)

How  would that query look like.
jamppiAsked:
Who is Participating?
 
QlemoConnect With a Mentor DeveloperCommented:
... which will most likely by transformed to
select A.*
from Assets A join Products P on A.ItemID = P.ItemID
where P.LocationID = 2

Open in new window

by the query optimizer.
0
 
Guru JiCommented:
Select * from Assets Where ItemId IN (Select ItemId from products where locationId =2)
0
All Courses

From novice to tech pro — start learning today.