我在 if 语句附近遇到了这种语法的问题,我不断检查附近的 mysql 语法
== 'purp1' and product_price==53, 13, 0) as ShipWeight
这就是我想要完成的。有任何想法吗?
select wp_cart66_order_items.order_id as Order_ID,
wp_cart66_orders.trans_id as Order_Number,
wp_cart66_orders.bill_first_name as Bill_First_Name,
wp_cart66_orders.bill_last_name as Bill_Last_Name,
wp_cart66_orders.ship_first_name as Ship_First_Name,
wp_cart66_orders.ship_last_name as Ship_Last_Name,
wp_cart66_orders.ship_address as Ship_Address1,
wp_cart66_orders.ship_address2 as Ship_Address2,
wp_cart66_orders.ship_city as Ship_City,
wp_cart66_orders.ship_state as Ship_State,
wp_cart66_orders.ship_zip as Ship_zip,
wp_cart66_order_items.item_number as Item_Number,
wp_cart66_order_items.product_price as Price,
wp_cart66_order_items.Description as OrderItemsDescription,
if(item_number == 'purp1' and product_price==53, 13, 0) as ShipWeight
from wp_cart66_orders
inner join wp_cart66_order_items
on wp_cart66_orders.id=wp_cart66_order_items.order_id
where wp_cart66_orders.ordered_on between "2013-04-01 00:00:00" and "2013-04-02 23:59:59"