帮改个Sql语句问题,谢谢
SELECT id,name FROM tb_category WHERE (id = 11) OR (id = (SELECT fid FROM tb_category AS b_category_1 WHERE (id = 322))) AND (fid = 11) OR (id = 322) 我想要的是 第一页显示的是id 322的那个,不要316的。
[解决办法]
贴出你的数据,还有你的结果
[解决办法]
SELECT id,name FROM tb_category WHERE
(id = 11) OR
(
id = (
SELECT fid FROM tb_category AS b_category_1 WHERE (id = 322)
)
AND (fid = 11))
OR (id = 322)