tags:

views:

37

answers:

1

I need to select records from table,but one field(id2 as example) replace with value from other table with id==id2 from first table

+1  A: 

If you want to SELECT the rows from a table where a column value is present in another tables column, then you need to use JOIN:

SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id2

Read this blog post by Jeff Atwood on the different joins.

Marius