The only way I know to do it is to take the column names from the INFORMATION_SCHEMA query and put them in a temp table. Then iterate over the column names in the temp table and execute dynamic sql to query the distinct values in those columns. Here is an example in T-SQL, so you'll have to make some changes.
CREATE TABLE #values
(
COLUMN_NAME VARCHAR(100),
DISTINCT_COUNT INT
)
DECLARE @column AS VARCHAR(100) = ''
SELECT COLUMN_NAME INTO #columns FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='dbo' AND TABLE_NAME='tbl'
SELECT TOP 1@column = COLUMN_NAME
FROM #columns
WHERE COLUMN_NAME > @column
ORDER BY COLUMN_NAME ASC
WHILE (@@ROWCOUNT > 0)
BEGIN
DECLARE @sql AS NVARCHAR(1000) = N'INSERT INTO #values (COLUMN_NAME, DISTINCT_COUNT) SELECT ''' + @column + ''', COUNT(DISTINCT ' + @column + N') FROM [db].[dbo].[tbl]'
EXECUTE sp_executesql @sql
SELECT TOP 1 @column = COLUMN_NAME
FROM #columns
WHERE COLUMN_NAME > @column
ORDER BY COLUMN_NAME ASC
END
SELECT * FROM #values
DROP TABLE #columns
DROP TABLE #values
This is pretty rough and just an example of how it can be done. If this were production code, I'd make sure the variable types are all consistent and make sure the column names are safe. This will help: How To have Dynamic SQL in MySQL Stored Procedure