代码之家  ›  专栏  ›  技术社区  ›  SomeUser

MySQL怎么做?

  •  0
  • SomeUser  · 技术社区  · 16 年前

    我需要从表中选择记录,但是一个字段(例如ID2)替换为第一个表中ID==ID2的其他表中的值

    1 回复  |  直到 16 年前
        1
  •  1
  •   Marius    16 年前

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

    Read this blog post by Jeff Atwood on the different joins