![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sqlserver
pengleong
这个作者很懒,什么都没留下…
展开
-
分组统计商品一星期每天的销售情况
商品销售表(orders)字段: 订单号(order_id int) 商品名(product_name nvarchar) 销售时间(sale_date int)记录星期如(1,2,3,4,5,6,7) 销售数量(sale_count int)查询商品一星期每天的销售记录,如下方式显示[table]|product_name|Sun|Mon|Tue|We...原创 2010-10-27 15:25:51 · 938 阅读 · 0 评论 -
三种方式查询A表的数据没有出现在B表的数据中(not in, left join, not exists)
A表(users)字段: uid int not null primary key, uname nvarchar(30) not nullB表(results)字段: rid int not null primary key, uid int not null(引用users表的uid)查询A表中的数据没有出现在B表中1.使用 not in[c...原创 2010-10-27 23:30:15 · 811 阅读 · 0 评论