Comments - TSQL To Maria DB SQL
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
Why does this Maria DB syntax differ so much from MySQL and i found it in Xammp package which includes MySql. Im gettin error in this code also :(
SELECT date(o.created_datetime) as Date, od.product_uid as 'Product UID',
p.manufacturer Manufacturer, p.bmc BMC, p.brand Brand, od.label as SKUs, p.selling_unit as 'Unit of Measure',
ROUND(if(od.amended_quantity is not null, od.amended_quantity, od.quantity)) as 'Units Sold',
ROUND((if(od.amended_quantity IS NOT NULL, od.amended_quantity, od.quantity))*p.content,2) as 'Sales Volume',
ROUND((if(od.amended_quantity is not null, od.amended_quantity, od.quantity))*od.price,2) as 'Sales Value'
FROM order_detail od
left join order o on od.order_uid=o.uid
left join product p on od.product_uid=p.uid
and not od.label ='Plastic Bag'
and date(o.created_datetime) >= '2020-03-01'
Sorry, it's suppose to be orders and not order :)