	SELECT
		A.`期数`,
		A.`报单`,
		(A.`报单`/A.`当期合计`) AS 报单比例,
		A.`复消` AS 重消,
		(A.`复消`/A.`当期合计`) AS 重消比例,
		A.`积分`,
		(A.`积分`/A.`当期合计`) AS 积分比例,
		A.`当期合计`

	FROM

		(SELECT P.PERIOD_NUM AS 期数,
			(
			SELECT SUM(`商品金额`) AS 报单 FROM zr_order_vw V WHERE V.`期数` = P.PERIOD_NUM AND 订单类型 = "报单"
			) 报单,
			(
			SELECT SUM(`商品金额`) AS 复消 FROM zr_order_vw V1 WHERE V1.`期数` = P.PERIOD_NUM  AND 订单类型 = "复消"
			) 复消,
			(
			SELECT SUM(`商品金额`) AS 积分 FROM zr_order_vw V2 WHERE V2.`期数` = P.PERIOD_NUM AND 订单类型 = "积分"
			) 积分,
			(
			SELECT SUM(`商品金额`) AS 当期合计 FROM zr_order_vw V WHERE V.`期数` = P.PERIOD_NUM
			) 当期合计
		FROM ar_period P
		WHERE P.PERIOD_NUM = 168) A