Slide 38
Slide 38 text
Lookerが生成するSQL
SELECT
COALESCE(ROUND(COALESCE(CAST( ( SUM(DISTINCT (CAST(ROUND(COALESCE(orders.total ,0)*(1/1000*1.0), 9) AS NUMERIC) +
(cast(cast(concat('0x', substr(to_hex(md5(CAST(orders.order_id AS STRING))), 1, 15)) as int64) as numeric) * 4294967296 + cast(cast(concat('0x',
substr(to_hex(md5(CAST(orders.order_id AS STRING))), 16, 8)) as int64) as numeric)) * 0.000000001 )) - SUM(DISTINCT (cast(cast(concat('0x',
substr(to_hex(md5(CAST(orders.order_id AS STRING))), 1, 15)) as int64) as numeric) * 4294967296 + cast(cast(concat('0x',
substr(to_hex(md5(CAST(orders.order_id AS STRING))), 16, 8)) as int64) as numeric)) * 0.000000001) ) / (1/1000*1.0) AS FLOAT64), 0), 6), 0) AS
orders_total_total,
COALESCE(SUM(order_items.quantity ), 0) AS order_items_total_quantity,
COALESCE(SUM(order_items.unit_price ), 0) AS order_items_total_unit_price
FROM `feedmatic-looker.sandbox_masutaka.orders` AS orders
LEFT JOIN `feedmatic-looker.sandbox_masutaka.order_items` AS order_items ON orders.order_id = order_items.order_id
LIMIT 1
これがポイント