1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Get the non-matching rows in SQL

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 17, 2024 às 10:05.

  1. Stack

    Stack Membro Participativo

    We have two SQL tables

    [​IMG] and [​IMG].

    Now, We have to do a merger of these two table in such a way that, table_1 seq_number which is not present in table_2, map with the tp_no = 0 Like this.

    We have to create this in SQL table so it could be used further.

    I am trying to achieve this by select distinct tar.c_Id,brd.Toucpoint,brd.sequence_number,tar.tot_Id,tar.tp_no from table_2 tar inner join (select distinct c_Id,channel,sequence_number from table_1) brd on tar.c_Id = brd.c_Id and tar.tp_no <> brd.sequence_number where tar.tp_no = '0' ;

    But this is not giving the desired output.

    [​IMG]

    Continue reading...

Compartilhe esta Página