whole row comparison
Date: 07/08/07
(MySQL Communtiy) Keywords: programming, mysql, sql
Short info:
Is there a way to use a * operator in a query like so:
`SELECT newSrc.*, oldSrc.* FROM current_raw_table newSrc LEFT JOIN yesterday_raw_table oldSrc ON(newSrc.id = oldSrc.id) WHERE newSrc.* != oldSrc.*);`
to use mysql to compare two tables of data created by a `load data infile` where one table is today's and the other is yesterday. My tests with using *'s failed so plan B is to use my l33t programming skillz to generate a bunch of
`if(newSrc.{fieldName} != oldSrc.{fieldName},"fieldName") as "{fieldName}",` then wrap the whole mess with concat_ws(' ',...);
but before I use said l33t skelz, I figured it might be smart to ask before I reinvent something else.
Source: http://community.livejournal.com/mysql/116735.html