gpt4 book ai didi

mysql - MySQL 中如何查询每行乘以 2 个单元格?

转载 作者:行者123 更新时间:2023-11-29 21:05:25 25 4
gpt4 key购买 nike

我想将每行乘以 2 个单元格,并将其值放入名为“总计”的最后一列中。这可以通过普通查询来完成吗?

示例:

Pieces | Price | Total
6 | 4 | null // should be 24
2 | 10 | null // should be 10

最佳答案

使用这个:

SELECT 
Pieces, Price,
Pieces * Price as 'Total'
FROM myTable

关于mysql - MySQL 中如何查询每行乘以 2 个单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36859355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com