//WHERE `Status`=0 AND FIND_IN_SET(Id,@pid) > 0 ",query.QCateIds);
builder.AppendFormat(@"
SELECT tabA.*
FROM (SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId>0) tabA,
(SELECT @pid := '{0}') pd
WHERE FIND_IN_SET(ParentId, @pid) > 0 AND @pid := concat(@pid, ',', id)
UNION
SELECT *
FROM rb_share_category
WHERE `Status`=0 AND FIND_IN_SET(Id,@pid) > 0 ",query.QCateIds);
SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0})
UNION ALL
SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN(SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0}) )
UNION ALL
SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN(SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN( SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0})) )
UNION ALL
SELECT * FROM rb_share_category WHERE `Status`=0 AND Id IN({0})