慕的地6264312
A表 A1B表 B1,B2C表C1,C2SQL如下1234567891011select case r1 when 1 then A1 else '' end as A1, case r2 when 1 then B2 else '' end as B2, case r3 when 1 then C2 else '' end as C2 from ( select A1,B2,C2 row_number() over (partiotion by A1 by B2,C2) as r1, row_number() over (partiotion by A1,B2 by C2) as r2, row_number() over (partiotion by A1,C2 by B2) as r3 from A,B,C where A.A1 = B.B1 and A.A1 = C.C1 ) T
POPMUISE
对,是少个逗号1234567891011select case r1 when 1 then A1 else '' end as A1, case r2 when 1 then B2 else '' end as B2, case r3 when 1 then C2 else '' end as C2 from ( select A1,B2,C2, row_number() over (partiotion by A1 by B2,C2) as r1, row_number() over (partiotion by A1,B2 by C2) as r2, row_number() over (partiotion by A1,C2 by B2) as r3 from A,B,C where A.A1 = B.B1 and A.A1 = C.C1 ) T把rownumber()换成row_number()