sql >> Database >  >> RDS >> Mysql

Operand moet 1 kolom bevatten - MySQL NIET IN

Er is altijd dit:

select *
from campaigns 
where id not in (
    select id_campaign from (
        select e.id_campaign as id_campaign, d.frequency, e.id
        from campaigns d left join served e on d.id = e.id_campaign
        where d.status = 'Active'
        group by e.id_campaign 
        having count(e.id) < d.frequency 
    )
)


  1. Voeg CreatedBy en CreatedOn in alle ontbrekende gegevenstabellen in SQL

  2. SQL Server Integration Services (SSIS) gebruiken om QuickBooks-records te vullen

  3. Top 9 databasebeheersystemen voor Joomla's sjablonen

  4. SQLite JSON_ARRAY_LENGTH()