就像这两表,我应该怎么查询商品分类为3的商品比商品分类为4的商品价格都小的商品编号,名称,价格、关键词 。
都小,则只要比最小的小就行了。
select id,name,price,keyword from sh_goods where category_id = 3 and price < (select min(price) from sh_goods where category_id = 4);
望采纳,谢谢!