title: How to remove currencies having count greater than 1 in mysql?
body: <p>I have a table called <strong>currency_country</strong> 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?</p>
  
  <p>I have tried these way but didnt help !</p>
  
  <pre><code>DELETE FROM `currency_country`
  WHERE currency_code NOT IN (
    SELECT currency_code
    FROM (
      SELECT currency_code
      FROM `currency_country`
      WHERE currency_code = 'EUR'
    ) temp
  );
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>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'
     )
  ;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GKr4q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GKr4q.png" alt="enter image description here"></a></p>