The scenario is as follows, a while ago a colleague accidentally ran a query similar to
DELETE FROM app_i18n WHERE disabled = 0 and translation is null or translation = '';
This is the table structure of app_i18n
CREATE TABLE app_i18n ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `category` INTEGER(11) unsigned NOT NULL, `keyword` varchar(50) DEFAULT NULL, `language` varchar(2) NOT NULL DEFAULT 'en', `translation` text NOT NULL, `disabled` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY (`category`, `keyword`, `language`, `disabled`) ) ENGINE=InnoDB;
The resulting problem is that some of those "translations" while empty were there for a reason. So a restore was in order. From an old copy of the db he restored all the rows that were empty or null and were not disabled.
The problem has been compounded by an unknown number of other developers quickly throwing in "translations" to fix the issues they were experiencing. So I thought the solution would be
SELECT id FROM app_i18n WHERE disabled = 0 AND (translation is null or translation = '') GROUP BY category, keyword, language HAVING COUNT(id) > 1;
Would that query yield the answers that I want? i.e. all records that having duplicate category, keywords in the same language which have duplicates?