ALSO_DB
asked on
SQL count used columns
hi there
I want a SQL statement with which i get all views with more than 230 columns AND which shows me which of these columns are explicit used.
any help would be appreciated!
I want a SQL statement with which i get all views with more than 230 columns AND which shows me which of these columns are explicit used.
any help would be appreciated!
ASKER
I would like to see which columns are used and which are unused.....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
If the column is filled with data --> the colum is used
if the column is empty --> the column is unused
if the column is empty --> the column is unused
Then you have to use a procedure to loop through all tables and find what are all the list of columns that are used and unused depending upon whether data is present in that table or not.
Can you kindly elaborate on your requirement so that I can think of some other possibilities.
Can you kindly elaborate on your requirement so that I can think of some other possibilities.
SELECT table_name
FROM information_schema.columns
GROUP BY table_name
HAVING count(*) > 230
Kindly explain me what you meant by explicit used..