form name uf_czssmz_dt1
CodePudding user response:
SELECT * FROM (
SELECT
ROW_NUMBER () OVER (PARTITION BY SFZH ORDER BY id) AS rids
, *
The FROM (
SELECT id, SFZH, 'A' AS flag FROM uf_czssmz
UNION ALL
SELECT id, SFZH, 'B' AS flag FROM uf_czssmz_dt1
) AS t
) AS t
WHERE t.r id=1