【问题标题】:Repetation of column when using join between two table在两个表之间使用连接时重复列
【发布时间】:2016-10-01 23:06:58
【问题描述】:

根据在 postgres 中使用选择查询沿着 8 或 9 表使用连接找到的输出作为

 1. A    2   34
 2. A    2   56
 3. B    3   34
 4. B    3   56

而我也需要两种形式的输出

 1. A    2   34
 2. A    2   34
 3. B    3   56
 4. B    3   56

    A    2   34
    B    3  56

我能做什么?

【问题讨论】:

    标签: sql postgresql join duplicates rows


    【解决方案1】:

    使用不同的?

    select distinct * from table
    

    【讨论】:

    • select distinct l.loacl_end_pop_address,l.numbers_line,m.total_bandwidth from new_reg_proposal_connectivity_dtl_at_pop l left join new_reg_proposal_connectivity_to_pop m on l.temp_reg_no=m.temp_reg_no where l.temp_reg_no='ABC'
    猜你喜欢
    • 2021-10-14
    • 2019-02-25
    • 2013-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 1970-01-01
    • 2020-10-04
    相关资源
    最近更新 更多