2013-06-02 87 views
0

好的。所以這就是我想要做的。MySQL - 多表選擇

products_description:
products_name | products_id

products_to_categories:
products_id | categories_id

categories_description:
categories_id | categories_name

基本上我想得到products_name其中categories_name等於'翻新'(產生多行)。任何幫助將不勝感激。

回答

0
SELECT p.product_names 

    FROM products_description p, products_to_categories pc, categories_description c 

    WHERE p.products_id = pc.products_id 

    AND pc.categories_id = c.categories_id 

    AND c.categories_name = "Refurbished" 
+0

突然我明白別名是如何工作的。你是凡人中的神。謝謝。 =) – Schtev