A query or datatable is required to find the difference between two tables

AMER SAID 396 Reputation points
2021-04-21T17:58:36.64+00:00

HI

I have a table between some products and another table with some products. I want to specify only the different products between the two tables.

table prod a --col prodnama
gh1
cd2
at3

table prodb --col prodnamb
at3
cd2

Result gh1

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,570 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 112.1K Reputation points
    2021-04-21T18:22:07.797+00:00

    If you need the names only, then check this query:

    (
        select prodnama from proda
        except
        select prodnamb from prodb
    )
    union all
    (
        select prodnamb from prodb
        except
        select prodnama from proda
    )
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful