mysql select id and name from other table and join query

前端 未结 2 1250
误落风尘
误落风尘 2020-12-01 21:58

i have 2 table named projects and tasks

in projects table i have:

id   name
---------
1    some

in tasks table i have:



        
2条回答
  •  青春惊慌失措
    2020-12-01 22:49

    SELECT t.*, p.[name] FROM tasks t
    INNER JOIN projects p
    ON t.project_id = p.[id]
    WHERE t.project_id = ____
    

    You fill in _ with the project_id you want

提交回复
热议问题