我有几个具有 UDID(唯一 ID)和其他信息的表。我正在尝试组合这些表,以便每个 UDID 在最终表中出现一次。我所有输入表中的数据看起来都是正确的,并且具有很好的理论意义。但是,当我查看输出表时,我一遍又一遍地看到相同的数据。
这是查询:
create table roi_wide_ss_gen_all as
select a.udid, a.src, a.tm8,a.tm7,a.tm6,a.tm5,a.tm4,a.tm3,a.tm2,a.tm1, a.t1, a.t2, a.t3, a.t4, a.t5,a.t6,a.t7,a.t8
, pf_m, female, asam, pf_50, pf_150, pf_250, pf_251
from roi_wide_ss_gen a
left outer join roi_wide_ss_gen_m b on (a.udid = b.udid)
left outer join roi_wide_ss_gen_f c on (a.udid = c.udid)
left outer join roi_wide_ss_gen_k d on (a.udid = d.udid)
left outer join roi_wide_ss_gen_50 e on (a.udid = e.udid)
left outer join roi_wide_ss_gen_150 f on (a.udid = f.udid)
left outer join roi_wide_ss_gen_250 g on (a.udid = g.udid)
left outer join roi_wide_ss_gen_251 h on (a.udid = h.udid)
left outer join roi_wide_ss_gen_as i on (a.udid = i.udid)
;
以下是输出表的前几行:
udid src tm8 tm7 tm6 tm5 tm4 tm3 tm2 tm1 t1 t2 t3 t4 t5 t6 t7 t8 pf_m female asam pf_50 pf_150 pf_250 pf_251
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
如果我让它持续 100 行,那么数据最终会发生一些变化,就像这样
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
2b4821ecf223b1f6 1 0 0 0 0 4 6 2 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
a6ce599b8344bb4c 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0
3f1448b00f8d8031 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1 1 0 0 0 0 0
fca0bd81bdc66de5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0
fca0bd81bdc66de5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0
但它仍然不是每个 UDID 的 1 行,就像大多数 UDID 一样。我可以发誓我过去可以正常工作,但是...