I want to compare content of 15 columns in two rows.
I am using db2 9 with jdbc.
Can I use a sql to get a result like “match or not match”
And How can I get columns differs?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the EXCEPT operator to do this.
In the example below, I’m using common table expressions to fetch a the single rows (assuming, in this case, that
idis the primary key.If this returns 0 rows, then the rows are identical. If it returns a row, then the two rows differ.
If you really want the result to be ‘MATCH’ or ‘NOT MATCH’: