三级分类的sql语句

SELECT ep1.*,ep2.name AS name1,ep3.name AS name2,ep4.name AS name3
FROM easybuy_product AS ep1,easybuy_product_category AS ep2,easybuy_product_category AS ep3,easybuy_product_category AS ep4
WHERE ep1.`categoryLevel1`=ep2.`id` AND ep1.`categoryLevel2`=ep3.`id` AND ep1.`categoryLevel3`=ep4.`id`

posted @ 2017-09-01 14:02  AlexanderTheGreat  阅读(1318)  评论(0编辑  收藏  举报