I have a table called currency_country that holds all currencie. Some Europe countries have old currencies as well. I want to remove all non EUR currencies from countries that have a EUR currency?
I have tried these way but didnt help !
DELETE FROM `currency_country`
WHERE currency_code NOT IN (
SELECT currency_code
FROM (
SELECT currency_code
FROM `currency_country`
WHERE currency_code = 'EUR'
) temp
);
and this
DELETE
FROM
`currency_country`
LEFT JOIN
country
on `currency_country`.`country_id` = country.`id`
WHERE
EXISTS
(
SELECT
*
FROM
`currency_country`
WHERE
EXISTS
(
SELECT
*
FROM
`currency_country`
WHERE
`currency_code` = 'EUR'
)
)
AND currency_code != 'EUR'
AND country.name IN
(
'Austria',
'Belgium',
'Cyprus',
'Netherlands',
'Estonia',
'Finland',
'France',
'Germany',
'Greece',
'Ireland',
'Italy',
'Latvia',
'Lithuania',
'Luxembourg',
'Malta',
'Monaco',
'Portugal',
'San Marino',
'Slovakia',
'Slovenia',
'Spain'
)
;