0

I am struggling in MySQL. I have 2 Tables, one Table with all the data and 1 table with generic information about a node.

dataTable

  • ID
  • Name

nodeTable

  • ID
  • Address

Now I have the Address and I want to build a query in which the Name is returned. I probably should use a JOIN but the last time I worked with MySQL goes way back.

Thanks in advance

Jeroen
  • 33
  • 7

3 Answers3

2
select
    dataTable.name
from
    dataTable
    inner join nodeTable on
        dataTable.ID = nodeTable.ID   
where
    nodeTable.adress = 'your address'
Indent
  • 4,583
  • 1
  • 15
  • 31
0

Does the below code fulfill your needs?

select Name 
  from dataTable, nodeTable 
 where dataTable.ID = nodeTable.ID
   and Address = 'Rathausstrasse'
inxoy
  • 3,444
  • 2
  • 12
  • 21
0
select d.name
from dataTable d, nodeTable n
on d.id = n.id
where n.address = '10 Main St.';
J_H
  • 10,963
  • 1
  • 18
  • 34