select * from yiqi_category as c,yiqi_permanent as p where c.pid = '0' and c.type = 'product' and c.cid = p.objectid and p.ptype = 'category' order by displayorder1