我有兩個表像如何加入兩個表,其中第二表有condtion
shopping_cart_table
和customer_table
shopping_cart_table
有場shoppingcart_id | home_No|
customer_table
有場shoppingcart_id | status| customer_type|
我想要得到的home_No
from shopping_cart_table WHERE (customer_table.status is null OR customer_table.status='Y') AND customer_table.customer_type='X'
這兩個表都可以加入shoppingcart_id
您的具體問題在哪裏? – 2014-12-03 08:18:37
問題是如何做到這一點 – user2771655 2014-12-03 08:19:45
對不起,如果這聽起來很刺耳,但這確實是非常基本的SQL東西。我建議你抓住一個SQL教程,並通過它。 – 2014-12-03 08:27:13