我想告訴我的查詢僅僅只有誰總訂單更大然後200MySQL的 - SQL查詢和與過濾
現在我的查詢是
SELECT
ps_orders.id_customer,
ps_customer.firstname,
ps_customer.lastname,
ps_customer.email,
ps_orders.total_paid
FROM
ps_orders
RIGHT JOIN ps_customer
on ps_orders.id_customer = ps_customer.id_customer
WHERE
ps_orders.total_paid > 1
ORDER BY
ps_orders.id_customer;
顯示這樣
id_customer firstname lastname email total_paid
--------------------------------------------------------
55 name8 name10 ***@windowslive.com 88.90
58 name6 name7 ****@hotmail.com 56.00
58 name6 name7 ****@hotmail.com 87.90
58 name6 name7 ****@hotmail.com 79.99
58 name6 name7 ****@hotmail.com 78.90
59 name3 name5 ****@hotmail.com 123.83
60 name name2 ****@hotmail.com 78.90
我想要這樣的演出
id_customer firstname lastname email total_paid
--------------------------------------------------------
58 name6 name7 ****@hotmail.com 302.49
'ps_orders.total_paid> 200 '? –
@Lashane,其僅示出了訂單更大然後200不使總和 – ZgrKARALAR
值得一提的是,用於搜索「RIGHT JOIN」上SO當前返回1530分的結果,與對「LEFT JOIN」的搜索相比較,其目前返回17960結果。 – Strawberry