我查詢MySQL數據庫在2008年SSRS的報告,我用下面連接兩個不同的查詢也沒問題......結合3次不同的查詢
SELECT a.arrivalDate, a.order_item_id, b.roomType
FROM
(select order_item_id, meta_value as arrivalDate from `wp_woocommerce_order_itemmeta` WHERE `meta_key` LIKE 'Arrival Date') as a,
(select order_item_id, meta_value as roomType from `wp_woocommerce_order_itemmeta` WHERE `meta_key` LIKE 'type-of-room') as b
WHERE a.order_item_id = b.order_item_id
...但是當我嘗試添加第三個,它的服用問題,我的WHERE子句,但我本可以發誓我用來做什麼的這樣:
SELECT a.arrivalDate, a.order_item_id, b.roomType, c.retreatDate
FROM
(select order_item_id, meta_value as arrivalDate from `wp_woocommerce_order_itemmeta` WHERE `meta_key` LIKE 'Arrival Date') as a,
(select order_item_id, meta_value as roomType from `wp_woocommerce_order_itemmeta` WHERE `meta_key` LIKE 'type-of-room') as b,
(select order_item_id, meta_value as retreatDate from `wp_woocommerce_order_itemmeta` WHERE `meta_key` LIKE 'retreat-date') as c,
WHERE a.order_item_id = b.order_item_id AND a.order_item_id = c.order_item_id
有什麼建議?
順便說一句,這不是我怎麼會做 - 但與SSRS標籤是什麼? – Strawberry
它適用於SSRS,並且它在SQL Server Report Builder – Tim
如果您知道另一種效率更高的方法,歡迎提供建議。 – Tim