Compare data from a table in PostgreSQL

-1

Good morning.

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

    
asked by anonymous 14.07.2017 / 16:46

1 answer

1

If the comparison is for all columns:

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

The ON clause accepts various comparisons.

    
15.07.2017 / 05:59