MySQL查询设置排序号1,2,3
SELECT DISTINCT (@i :=@i + 1) AS num, -- 设置排序号 b.pb_dl_name, a.* FROM xqxz_familyinfo a LEFT JOIN xqxz_planbuild b ON a.pb_id=b.pk_id, (SELECT @i := 0) AS it -- 设置排序号
SELECT DISTINCT (@i :=@i + 1) AS num, -- 设置排序号 b.pb_dl_name, a.* FROM xqxz_familyinfo a LEFT JOIN xqxz_planbuild b ON a.pb_id=b.pk_id, (SELECT @i := 0) AS it -- 设置排序号