powerApower 2017-06-15 02:09 采纳率: 0%
浏览 3778
已结题

MYSQL 单一表格 多次查询取交集和并集合

 select * from info where id like binary "%"#{text1}"%" or info_type like binary "%"#{text1}"%" or type like binary "%"#{text1}"%" or release1 like binary "%"#{text1}"%"
        or effective_s like binary "%"#{text1}"%" or effective_o like binary "%"#{text1}"%" or compete like binary "%"#{text1}"%" or region like binary "%"#{text1}"%" or product like binary "%"#{text1}"%" or source like binary "%"#{text1  }"%"or content like binary "%"#{text1}"%" or impact like binary "%"#{text1}"%" or stime like binary "%"#{text1}"%" 

同一张表格进行三次不同内容模糊查询。现在需要第一次查询与第二次查询取并级后,产生的结果集再与第三次查询的结果集取交集。SQL语句怎么写呢,用的mysql数据库。spring+mybatis框架

  • 写回答

3条回答 默认 最新

  • nullPointerMrlu 2017-06-15 02:28
    关注

    13 23左外关联取交集 然后两个表union 或者12union然后和3左外关联

    评论

报告相同问题?