统计查询商品类别名称为“一体机”、“台式机”两类商品的销售情况,输出产品号、销售总数、销售总额,结果按商品号升序排列。
时间: 2024-06-06 22:06:56 浏览: 8
SELECT
product_id AS 产品号,
SUM(quantity) AS 销售总数,
SUM(quantity * unit_price) AS 销售总额
FROM
order_items
JOIN products ON order_items.product_id = products.id
JOIN categories ON products.category_id = categories.id
WHERE
categories.name IN ('一体机', '台式机')
GROUP BY
product_id
ORDER BY
product_id ASC;
相关问题
android realm 查询 设备类型为电脑且不为台式 和 设备类型为打印机的 设备集合
您好!关于您的问题,我可以为您提供一些参考信息。在 Android Realm 中,您可以使用以下代码查询设备类型为电脑且不为台式机的设备集合:
```
RealmResults<Device> devices = realm.where(Device.class)
.equalTo("type", "computer")
.notEqualTo("subtype", "desktop")
.findAll();
```
同时,如果您需要查询设备类型为打印机的设备集合,可以使用以下代码:
```
RealmResults<Device> devices = realm.where(Device.class)
.equalTo("type", "printer")
.findAll();
```
希望这些信息可以对您有所帮助!如果您有其他问题,欢迎随时提出。
小米电脑管家安装台式机
小米电脑管家是小米公司推出的一款电脑优化软件,可以帮助用户清理垃圾文件、优化系统性能、提升电脑运行速度等。安装小米电脑管家到台式机的步骤如下:
1. 打开小米电脑管家官方网站或者应用商店,下载安装包。
2. 双击安装包,按照提示完成软件的安装过程。
3. 安装完成后,打开小米电脑管家软件。
4. 在软件界面上,你可以看到各种功能选项,如清理垃圾、加速启动、优化网络等。
5. 根据自己的需求,选择相应的功能进行操作。
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)