1

I am getting the Error:

Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous

SELECT `main_table`.*, CONCAT(soa.firstname,' ', soa.lastname,'', soa.street,'', soa.city,'', soa.region,'', soa.postcode)  AS `full_address`, CONCAT(soas.firstname,' ', soas.lastname,'', soas.street,'', soas.city,'', soas.region,'', soas.postcode) AS `full_address_ship`, group_concat(`sales/order_item`.sku SEPARATOR ', ') AS `skus`, group_concat(`sales/order_item`.name SEPARATOR ', ') AS `names`, group_concat(`sales/order_item`.product_id SEPARATOR ', ') AS `proid`, group_concat(`sales/order_item`.product_type SEPARATOR ' ') AS `product_type`, `order`.`total_qty_ordered`, `order`.`customer_email` AS `emailbuyer` FROM `sales_flat_order_grid` AS `main_table`
 INNER JOIN `sales_flat_order_address` AS `soa` ON soa.parent_id=main_table.entity_id and soa.address_type = 'billing'
 INNER JOIN `sales_flat_order_address` AS `soas` ON soas.parent_id=main_table.entity_id and soas.address_type ='shipping'
 INNER JOIN `sales_flat_order_item` AS `sales/order_item` ON `sales/order_item`.order_id=`main_table`.entity_id
 LEFT JOIN `sales_flat_order` AS `order` ON order.entity_id = main_table.entity_id WHERE (status = 'processing') GROUP BY `main_table`.`entity_id` ORDER BY main_table.created_at DESC LIMIT 20

Why can't it find the status column?

1 Answer 1

1

Here you have used more than one table so you have to use table.status instead of only status.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.