用这个。
with customers as (select '1424' id_customer, '13-Feb-15' date_purchase, 'Petr' name_first, 'Kellner' name_last, 'Chicago' name_city from dual
union all
select '1425' id_customer, '13-Feb-15' date_purchase, 'Shelley' name_first, 'Birdwick' name_last, 'San Jose' name_city from dual
union all
select '1426' id_customer, '13-Feb-15' date_purchase, 'Morris' name_first, 'Moore' name_last, 'San Fransisco' name_city from dual
union all
select '1427' id_customer, '13-Feb-15' date_purchase, 'Shyam' name_first, 'Bajaj' name_last, 'Detroit' name_city from dual
union all
select '1428' id_customer, '13-Feb-15' date_purchase, 'Xu' name_first, 'Wang' name_last, 'New York' name_city from dual),
orders as (select '1224215' id_order, '1425' id_customer, '13-Feb-15' date_purchase, '235' amount_product, 'Name of Book' name_product from dual
union all
select '1224216' id_order, '1424' id_customer, '13-Feb-15' date_purchase, '356' amount_product, 'Name of Book' name_product from dual
union all
select '1224217' id_order, '1426' id_customer, '13-Feb-15' date_purchase, '263' amount_product, 'Name of Book' name_product from dual
union all
select '1224218' id_order, '1426' id_customer, '13-Feb-15' date_purchase, '326' amount_product, 'Name of Book' name_product from dual
union all
select '1224219' id_order, '1427' id_customer, '13-Feb-15' date_purchase, '236' amount_product, 'Name of Book' name_product from dual
union all
select '1224220' id_order, '1428' id_customer, '13-Feb-15' date_purchase, '233' amount_product, 'Name of Book' name_product from dual
union all
select '1224221' id_order, '1426' id_customer, '13-Feb-15' date_purchase, '633' amount_product, 'Name of Book' name_product from dual
union all
select '1224222' id_order, '1424' id_customer, '13-Feb-15' date_purchase, '235' amount_product, 'Name of Book' name_product from dual
union all
select '1224215' id_order, '1426' id_customer, '13-Feb-15' date_purchase, '632' amount_product, 'Name of Book' name_product from dual
union all
select '1224215' id_order, '1425' id_customer, '13-Feb-15' date_purchase, '236' amount_product, 'Name of Book' name_product from dual)
select customers.name_first, customers.name_last, count(distinct id_order) orders, sum(amount_product) total_amount
from customers left join orders on customers.id_customer = orders.id_customer group by customers.name_first, customers.name_last;