Trying to perform MINUS operation in MySQL

前端 未结 6 432
野性不改
野性不改 2020-11-29 10:21

I am trying to perform a MINUS operation in MySql.I have three tables:

  1. one with service details
  2. one table with states that a service is o
6条回答
  •  无人及你
    2020-11-29 11:11

    MySql does not recognise MINUS and INTERSECT, these are Oracle based operations. In MySql a user can use NOT IN as MINUS (other solutions are also there, but I liked it lot). Example:

    select a.id 
    from table1 as a 
    where  
    AND a.id NOT IN (select b.id 
                     from table2 as b 
                     where );
    

提交回复
热议问题