I run an SQL for a user and it work perfect! The code is pretty straight forward delete a table, create a table where we examine coulmn1 & group by coulmn1. Write out to the table any all data where column2 data differs. See code below-
DROP TABLE IF EXISTS OUTPUT1;
CREATE TABLE LIB1/OUTPUT1 AS(
SELECT *
FROM INPUTPF
WHERE COLUMN1 IN (
SELECT COLUMN1
FROM INPUTPF
GROUP BY COLUMN1
HAVING COUNT(DISTINCT COLUMN2) > 1)
)
WITH DATA;
The user now has asked to include a third element (i.e. COLUMN3) in the selection criteria. That is, using the code above they want to select COLUMN2 if they differ OR COLUMN3 if it differs.
What is the most efficient way to expand the table given the above code?
having count(distinct column2) > 1 or count(distinct column3) > 1