sql Miva Merchant - 客户订单历史报告

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql Miva Merchant - 客户订单历史报告相关的知识,希望对你有一定的参考价值。

SELECT
	customer.login AS "Account Login",
	customer.pw_email AS "Account Email",

	customer.ship_fname AS "Ship. First Name",
	customer.ship_lname AS "Ship. Last Name",
	customer.ship_email AS "Ship. Email",
	customer.ship_comp AS "Ship. Company",
	customer.ship_phone AS "Ship. Phone",
	customer.ship_fax AS "Ship. Fax",
	customer.ship_addr AS "Ship. Address",
	customer.ship_city AS "Ship. City",
	customer.ship_state AS "Ship. State",
	customer.ship_zip AS "Ship. Zip",
	customer.ship_cntry AS "Ship. Country",

	customer.bill_fname AS "Bill. First Name",
	customer.bill_lname AS "Bill. Last Name",
	customer.bill_email AS "Bill. Email",
	customer.bill_comp AS "Bill. Company",
	customer.bill_phone AS "Bill. Phone",
	customer.bill_fax AS "Bill. Fax",
	customer.bill_addr AS "Bill. Address",
	customer.bill_city AS "Bill. City",
	customer.bill_state AS "Bill. State",
	customer.bill_zip AS "Bill. Zip",
	customer.bill_cntry AS "Bill. Country",

	SUM(orders.total) AS "Total Spent",
	COUNT(orders.id) AS "Number of Orders",
	FROM_UNIXTIME(MIN(orders.orderdate)) AS "Date of First Order",
	FROM_UNIXTIME(MAX(orders.orderdate)) AS "Date of Last Order"
FROM s01_Customers AS customer
JOIN s01_Orders AS orders
	ON customer.id = orders.cust_id
GROUP BY customer.id
ORDER BY customer.login ASC

以上是关于sql Miva Merchant - 客户订单历史报告的主要内容,如果未能解决你的问题,请参考以下文章

html Miva Merchant - KSE变量

xml Miva Merchant - 静态页面RSS Feed

html Miva Merchant - 查找PageFinder的产品页面名称

html Miva Merchant - 查找PageFinder的分类页面名称

html Miva Merchant:保存最后4位信用卡

html Miva - 平面文件订单导出