SELECT
rownum as xh, *
FROM
q_materialfusion
where sjbj = '0'
and (
instr(mc, '1') > 0
OR instr(ssxmmc, '1') > 0
OR instr(ssxtzc, '1') > 0
OR instr(xinghao, '1') > 0
OR instr(gg, '1') > 0
)
and rownum = 1
```
SELECT
rownum as xh,
t.*
FROM (
SELECT *
FROM q_materialfusion
WHERE sjbj = '0'
AND (
mc LIKE '%1%'
OR ssxmmc LIKE '%1%'
OR ssxtzc LIKE '%1%'
OR xinghao LIKE '%1%'
OR gg LIKE '%1%'
)
ORDER BY nf DESC, mc ASC
)
WHERE rownum BETWEEN 1 AND 500;
```
通意千问说改成这样
SELECT
t.rownum as xh,
t.*
FROM
(
SELECT
*
FROM
q_materialfusion
WHERE sjbj = '0'
AND ( instr(mc, '1') > 0
OR instr(ssxmmc, '1') > 0
OR instr(ssxtzc, '1') > 0
OR instr(xinghao, '1') > 0
OR instr(gg, '1') > 0)
ORDER BY
nf DESC,
mc ASC
) t
WHERE
t.rownum >= 501