1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

[SQL] How can I compare rows of two similar tables in SQL?

Discussão em 'Outras Linguagens' iniciado por Stack, Julho 28, 2021.

  1. Stack

    Stack Membro Participativo

    These TSQL tables are exact but I can't guarantee that. I cannot guarantee which rows will be non-existent in either table.

    [​IMG]

    What I want to be able to do is to subtract one from the other into a new table. For instance, "Agg Asslt" should have a column value for "OffenseCount" of 6. However, "Theft Veh" should be -25. If a row does not exist in one or the other table, I will be either subtracting 0 or subtracting from 0. These are always integers. I hope this makes sense. If the row does not exist in either table, the point is moot. Thank you in advance.

    Continue reading...

Compartilhe esta Página