user3022986
user3022986

Reputation: 1

Select from 2 tables in SQL server

I have 2 tables in my database, tell and phone:

Table tell:

Table phone:

I wanted to select id and name and number

Please help me.

Upvotes: 0

Views: 85

Answers (2)

Swathi
Swathi

Reputation: 84

SELECT t.id, t.name, p.number
  FROM tell t 
  JOIN phone p
    ON t.name = p.name

Upvotes: 3

Andrew
Andrew

Reputation: 8758

You'll just need to join the two tables together on the name column:

   select
    t.id,
    t1.name,
    p.number
    from
    tell t
    inner join
    phone p
    on t.name = p.name

Upvotes: 3

Related Questions