jamppi
asked on
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.
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.
Select * from Assets Where ItemId IN (Select ItemId from products where locationId =2)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.