v.7 DB2
I am trying to get a DISTINCT list of colnames
AND which tables they are first found in
example: (This is what I do NOT want-see the colanmes are repeated)
colname tabname
c_1 x
c_2 x
c_3 y
colname tabname
c_1 x
c_2 x
c_1 y
c_3 y
here is my SQL:
SELECT colname,tabname
FROM SYSCAT.COLUMNS
WHERE TABSCHEMA ='ZW'
group by colname
order by colname