henrik1782
IS-IT--Management
I use this MySQL list to update the Country (LAND) based on e-mail endings, but it will search the entire table each time. Isen't there a more effective way to do this?
UPDATE `Bruger_data` SET `LAND` = "Denmark" WHERE `EMAIL` LIKE '%.dk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Faroe Islands" WHERE `EMAIL` LIKE '%.fo' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Greenland" WHERE `EMAIL` LIKE '%.gl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Norway" WHERE `EMAIL` LIKE '%.no' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Sweden" WHERE `EMAIL` LIKE '%.se' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Finland" WHERE `EMAIL` LIKE '%.fi' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Argentina" WHERE `EMAIL` LIKE '%.ar' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "France" WHERE `EMAIL` LIKE '%.fr' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "India" WHERE `EMAIL` LIKE '%.in' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Netherlands" WHERE `EMAIL` LIKE '%.nl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Taiwan" WHERE `EMAIL` LIKE '%.tw' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Poland" WHERE `EMAIL` LIKE '%.pl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Czech Republic" WHERE `EMAIL` LIKE '%.cz' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Latvia" WHERE `EMAIL` LIKE '%.lv' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "South Africa" WHERE `EMAIL` LIKE '%.za' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Australia" WHERE `EMAIL` LIKE '%.au' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Great Britain" WHERE `EMAIL` LIKE '%.co.uk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Belgium" WHERE `EMAIL` LIKE '%.be' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "New Zealand" WHERE `EMAIL` LIKE '%.co.nz' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Slovenia" WHERE `EMAIL` LIKE '%.si' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Brazil" WHERE `EMAIL` LIKE '%.com.br' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Israel" WHERE `EMAIL` LIKE '%.co.il' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Switzerland" WHERE `EMAIL` LIKE '%.ch' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Ireland" WHERE `EMAIL` LIKE '%.ie' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Canada" WHERE `EMAIL` LIKE '%.ca' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Hungary" WHERE `EMAIL` LIKE '%.hu' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Russia" WHERE `EMAIL` LIKE '%.ru' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Spain" WHERE `EMAIL` LIKE '%.es' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Slovakia" WHERE `EMAIL` LIKE '%.sk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Bulgaria" WHERE `EMAIL` LIKE '%.bg' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Italy" WHERE `EMAIL` LIKE '%.it' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Germany" WHERE `EMAIL` LIKE '%.de' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "China" WHERE `EMAIL` LIKE '%.cn' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Austria" WHERE `EMAIL` LIKE '%.at' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Cyprus" WHERE `EMAIL` LIKE '%.cy' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Denmark" WHERE `SPROG` = "DA" AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Norway" WHERE `SPROG` = "NO" AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Sweden" WHERE `SPROG` = "SV" AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Denmark" WHERE `EMAIL` LIKE '%.dk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Faroe Islands" WHERE `EMAIL` LIKE '%.fo' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Greenland" WHERE `EMAIL` LIKE '%.gl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Norway" WHERE `EMAIL` LIKE '%.no' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Sweden" WHERE `EMAIL` LIKE '%.se' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Finland" WHERE `EMAIL` LIKE '%.fi' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Argentina" WHERE `EMAIL` LIKE '%.ar' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "France" WHERE `EMAIL` LIKE '%.fr' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "India" WHERE `EMAIL` LIKE '%.in' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Netherlands" WHERE `EMAIL` LIKE '%.nl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Taiwan" WHERE `EMAIL` LIKE '%.tw' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Poland" WHERE `EMAIL` LIKE '%.pl' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Czech Republic" WHERE `EMAIL` LIKE '%.cz' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Latvia" WHERE `EMAIL` LIKE '%.lv' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "South Africa" WHERE `EMAIL` LIKE '%.za' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Australia" WHERE `EMAIL` LIKE '%.au' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Great Britain" WHERE `EMAIL` LIKE '%.co.uk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Belgium" WHERE `EMAIL` LIKE '%.be' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "New Zealand" WHERE `EMAIL` LIKE '%.co.nz' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Slovenia" WHERE `EMAIL` LIKE '%.si' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Brazil" WHERE `EMAIL` LIKE '%.com.br' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Israel" WHERE `EMAIL` LIKE '%.co.il' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Switzerland" WHERE `EMAIL` LIKE '%.ch' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Ireland" WHERE `EMAIL` LIKE '%.ie' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Canada" WHERE `EMAIL` LIKE '%.ca' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Hungary" WHERE `EMAIL` LIKE '%.hu' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Russia" WHERE `EMAIL` LIKE '%.ru' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Spain" WHERE `EMAIL` LIKE '%.es' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Slovakia" WHERE `EMAIL` LIKE '%.sk' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Bulgaria" WHERE `EMAIL` LIKE '%.bg' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Italy" WHERE `EMAIL` LIKE '%.it' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Germany" WHERE `EMAIL` LIKE '%.de' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "China" WHERE `EMAIL` LIKE '%.cn' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Austria" WHERE `EMAIL` LIKE '%.at' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Cyprus" WHERE `EMAIL` LIKE '%.cy' AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Denmark" WHERE `SPROG` = "DA" AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Norway" WHERE `SPROG` = "NO" AND `LAND` = "Not set";
UPDATE `Bruger_data` SET `LAND` = "Sweden" WHERE `SPROG` = "SV" AND `LAND` = "Not set";