jeudi 14 juillet 2016

Find rows with matched PK and different value in any columns in 2 table

It is easy to implement a select with known columns,the question is if the columns that need to be contrastted is not known, how to do it with only MYSQL(no other programm language)

  • assumption1: the columns in table A is same as table B
  • assumption2: all columns in table need to be traversing

@this is pseudo code select B.* from A inner join B on A.pk =b.pk where A.columns <> B.columns @it means any corresponding columns is not equal the possible solution is write a function or procedure in the sql script?

Aucun commentaire:

Enregistrer un commentaire