Compare data from a table in Postgresql

Asked

Viewed 1,291 times

-1

Good morning.

I have two tables in the same database, with the same name, but in different schemes. I want to compare the records that are in them, to see if there are identical data. Is there any software that does this?

  • 1

    You can do this via same query, just need to define what/which are identical data.

1 answer

1

If the comparison is all columns:

SELECT sc.*, gc.*
  FROM geral.cargo gc
 INNER JOIN serv.cargo sc 
    ON gc.* <> sc.* 
   AND gc.id=sc.id;

The clause ON accepts several comparisons.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.