MYSQL select query based on another tables entries

前端 未结 2 934
情深已故
情深已故 2020-12-19 06:13

I have stumped on this as I am a total beginner in MySql.

Here is a the basic of how the two tables are formed

Table 1 id,product_id, product_name

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-19 07:05

    It's pretty simple to join two tables:

    select t1.* 
    from Table1 t1
    join Table2 t2 on t1.product_id = t2.product_id
    where t2.active = 'Y'
    

提交回复
热议问题