Please tell me what kind of query (if it is possible at all), you can compare the sirovyna and invent tables; all fields of them are identical and do not match the rows to another inventold table. Table sirovyna

Invent table

  • one
    Not matching by what criterion? If the record is almost the same, only the date will differ by 1 second - output them the same way and what exactly to output both variants of the line (after all, there is no such pair in any of the tables) - Mike
  • one
    In general, something like that. ru.stackoverflow.com/questions/650000/ ... The query can be simplified if you do not need to know exactly which of the tables contains a unique row and also group by the columns that need to be compared - Mike

1 answer 1

SELECT * FROM ( SELECT * FROM sirovyna AS s LEFT JOIN invent AS i ON s.id = i.id UNION SELECT * FROM sirovyna AS s RIGHT JOIN invent AS i ON s.id = i.id ) WHERE s.id IS NULL OR i.id IS NULL 

here is useful information on this topic sql joins as venn diagram

How to do a FULL OUTER JOIN in MySQL?