0

I have:

Table1 (UserID -City - Adress - Mobile)
Table2 (DeviceID - UserID - Vendor - Model).

I want to perform nested query to select the following in one row:

 select DeviceID, UserID, Model From Table2 Where Vendor=Sony 
(and for this row go and select City - Address - Mobile from table 1 where table1.UserID = Table2.UserID)

How can I perfom the second select in the same query to be printed in the same row after Model.

1 Answer 1

1

Use inner JOIN

select 
      t2.DeviceID
    , t2.UserID
    , t2.Model
    , t1.city 
    , t1.Address
    , ti.mobile
From Table2 as t2
Where Vendor='Sony'
INNER JOIN table1 as t1 on  t1.UserID = t2.UserID
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.