Hello,
I need to create a single SQL query which returns all the tables where the columns CREATED_By and UPDATED_BY are NULL.
I was able to do it on individual table which returns the rows where value is NULL, but i want all Tables Names only in database with NULL value, no need for the entire data to be returned.
Please help me on this!!
I am trying something like this, but unsuccessful,
SELECT DISTINCT `TABLE_NAME` FROM INFORMATION_SCHEMA.COLUMNS WHERE `COLUMN_NAME` LIKE ("%CREATED_BY%" and "%UPDATED_BY%")IS NULL or `COLUMN_NAME` LIKE ("%CREATED_BY%" and "%UPDATED_BY%") = ' ' ORDER BY `UPDATED_BY` DESC
Discussion posts and replies are publicly visible
Hi Siva, Technically, you could probably do this with a stored procedure having output parameters, or a tabular function. This is going to be expensive to run.
What's your use case?Are you planning something to do routinely, or are you planning cleanup?Do you really want every table in the db?