可能重复:
MySQL 查询 - 'CAST' ' CONCAT' - 如何将几行数据乘以一定数量并在新列中显示它们各自的总数?
这是我的查询,但我想通过将计数乘以 1.50 英镑来在总价列中显示以英镑为单位的值。目前他们只是显示'BLOB'值,我做错了什么?我无法弄清楚,任何帮助都非常感谢......
SELECT CONCAT_WS(" ", c.customer_title, c.customer_fname, c.customer_sname) AS Customer,
COUNT(O.order_name) AS Ordertotal, concat('£' * 1.5) TotalPrice
FROM Order O, Friend F, Customer C, FriendOrder
WHERE C.customer_id = F.Customer_id
AND F.Friend_id = FriendOrder.friend_id
AND O.order_id = FriendOrder.order_id
GROUP BY Customer
ORDER BY C.customer_sname, C.customer_fname
结果:ps出于保密原因,我已将客户名称列排除在外
Name COUNT totalPrice
4 BLOB
2 BLOB
1 BLOB
3 BLOB
3 BLOB
3 BLOB
1 BLOB
1 BLOB
2 BLOB
3 BLOB
2 BLOB