SQL语句练习

product 表  product_name、spu、create_datetime
想要查找商品名称中包涵短袖的商品一共有多少个
select count*from product where product_name like "%短袖%"
shop 表 中有shop_name、channel_id、status、
product 表  product_name、spu、create_datetime

想要查找 符合 product_name为上衣短袖且spu是123且create_datetime为2021年5月5日,channel_id为JD的shop_name

UID关联字段
select s.shop_name from shop s left join product p on s.UID=p.UID and p.product_name="上衣短袖" and p.spu="123" and p.create_datetime="2021年5月5日" and s.channel_id="JD"

 

posted @ 2021-07-01 13:43  Camillezxl  阅读(54)  评论(0)    收藏  举报