3
在我的應用程序中,有發佈者和類別。一個發佈者可以屬於幾個類別。當我創建我的mysql事務時,它將爲它所屬的每個類別返回相同的發佈者記錄。這裏的查詢:從mysql查詢獲取不同記錄
SELECT grdirect_publisher.name, grdirect_publisher.short_description, grdirect_publisher.thumb_image, grdirect_publisher.url, grdirect_category.name AS catname FROM grdirect_publisher JOIN grdirect_publisher_categories ON grdirect_publisher.id = grdirect_publisher_categories.publisher_id JOIN grdirect_category ON grdirect_publisher_categories.category_id = grdirect_category.id
回報:
從本質上講,富應該只在結果中顯示一次。
如果你想Foo只出現一次,你想看哪個名字:視頻遊戲或音樂? – 2008-11-08 08:31:08