我在phpMyAdmin上运行以下查询 我获得了数据但是在点击导出时它会重定向到sql查询选项卡
Select
sad.firstname,
sad.lastname,
sfo.base_total_invoiced,
sad.email,
sad.telephone,
sad.postcode,
sad.street,
sad.locality,
sad.city
From
sales_flat_order_address sad
Inner join
customer_address_entity cae ON sad.entity_id = cae.entity_id
Inner join
pincode_24_11_2015 pc ON sad.postcode = pc.pincode
Inner join
pincode_city_state_map pcs ON pc.pincode_id = pcs.pincode_id
Inner join
city c on pcs.city_id = c.city_id
Inner join
sales_flat_order sfo on sad.entity_id = sfo.entity_id
Where
sad.city = "Pune"
And
cae.created_at Between "2015-01-01 00:00:00" And "2016-01-07 00:00:00";
有人可以帮忙吗?
答案 0 :(得分:1)
删除表别名(使用实际表名)
SELECT
sales_flat_order_address.firstname,
sales_flat_order_address.lastname,
sales_flat_order.base_total_invoiced,
sales_flat_order_address.email,
sales_flat_order_address.telephone,
sales_flat_order_address.postcode,
sales_flat_order_address.street,
sales_flat_order_address.locality,
sales_flat_order_address.city
FROM sales_flat_order_address
INNER JOIN customer_address_entity
ON sales_flat_order_address.entity_id = customer_address_entity.entity_id
INNER JOIN pincode_24_11_2015
ON sales_flat_order_address.postcode = pincode_24_11_2015.pincode
INNER JOIN pincode_city_state_map
ON pincode_24_11_2015.pincode_id = pincode_city_state_map.pincode_id
INNER JOIN city
ON pincode_city_state_map.city_id = city.city_id
INNER JOIN sales_flat_order
ON sales_flat_order_address.entity_id = sales_flat_order.entity_id
WHERE sales_flat_order_address.city = "Pune"
AND customer_address_entity.created_at BETWEEN "2015-01-01 00:00:00" AND "2016-01-07 00:00:00";