开发者社区 问答 正文

MySQL语句合并的问题

22
四条sql能合并成一条吗?

展开
收起
落地花开啦 2016-02-07 17:12:54 2129 分享 版权
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

    你自己试一下
    `select * from ecs_goods t1
    where goods_id in (select goods_id from ecs_goods t2
    where t2.is_hot = '1' and t2.goods_menu = t1.goods_menu order by goods_id desc limit 3)
    and t1.is_hot = '1' and t1.goods_menu in ('1','2','4','5')`

    2019-07-17 18:39:14
    赞同 展开评论