0
嘿,夥計們,所以我的查詢沒有返回我的工會結果時,我指定我的主要選擇列名,又名聯盟選擇不顯示聯盟結果
SELECT inspection_number, region, report_date,
inspection_type AS type, customer, customer_number, shipper, po
FROM reports
JOIN (
(
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `berries`
)
UNION (
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `melons`
)
UNION (
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `citrus`
)
UNION (
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `table_grapes`
)
UNION (
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `tree_fruit`
)
UNION (
SELECT `key`, `report_key`, `shipper`, `po`, `commodity`, `label`, `status`
FROM `lot`
)
) fruits ON inspection_number = fruits.report_key
WHERE fruits.status = '0' OR fruits.status = '1'
ORDER BY report_date DESC
不返回key
,report_key
,shipper
,po
,commodity
,label
,或status
奇怪運行
SELECT *
inspection_type AS type, customer, customer_number, shipper, po
FROM reports
JOIN (-- etc.....
Will?我怎樣才能解決這個問題?
只是想通了這一點太;) – ehime 2012-02-23 21:06:11