in my table 'entites' i store some tablenames in column 'tablename' of the used database. Now i want to get all tablenames of the database who are not in entites.tablename
Here is my statement:
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'codeigniter'
AND table_name COLLATE utf8_general_ci NOT IN (
(SELECT concat(tablename) FROM codeigniter.entities)
)
This works fine, but i'm not shure that this is th best practice:
My database and all tables and columns has 'utf8_unicode_ci' collation, the information_schema has 'utf8_general_ci' collation.
structur of table 'entites' in database codeigniter :
(
`id` int(32) NOT NULL AUTO_INCREMENT,
`tablename` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=13 ;