I have a SQL which results , the number of tables which uses EMAIl ID field, I have more than 60 tables which uses that EMAILID field. I want to find out how many of those 60 tables have values stored in EMAILID field and how many of them are blank
select table_name, num_rows from dba_tables
where table_name in (SELECT DISTINCT A.RECNAME FROM TABLE1 A,TABLE2 B
A.TAB_NAME = B.TAB_NAME
AND (A.FIELDNAME = 'EMAILID' OR A.FIELDNAME = 'URL'))
AND NUM_ROWS > 0;
Table1 store all information related to Record & fields , what are the fields associated to each table. Table2 stores the record definition.