How To Compare 2 Tables In Sql?

Asked By 10 points N/A Posted on -
qa-featured

I am working on SQL as part of a school project I am making. The front end is Java netbeans. I have two tables and I want to compare them and confirm that they have no similar records. How to compare 2 tables in sql?

SHARE
Answered By 0 points N/A #93265

How To Compare 2 Tables In Sql?

qa-featured

SQL is a very diverse software. I think whenever you are programming, you should refer the website called “stackoverflow”. It will address your basic queries and also advanced ones. For your current query, to compare two sql tables, you should use the minus function. (may also be called the ‘except’ function)

The syntax is this:

select * from table1 minus select * from table2

If it returns no results, that means there are no similar records. If it returns, then delete those records from any one table.

Related Questions