SELECT tblproducts.*,tblproductsitems.*,tblcustomersordersitems.*, tblproductsitems.catalogID AS catalogID,tblproductsitems.barCode, tblproductscontentslangs.title as baseProductName, tblproductscontentslangs.description AS description,tblproductscontentslangs.title AS productName, tblproductscontentslangs.metaDescription AS metaDescription,tblproductscontentslangs.content AS content, tblproductscontentslangs.content2 AS content2,tblcurrency.curenMark,tblproductsitems.id AS id, tblproducts.id AS productID,tblcurrency.curenMark AS currency,tblproductscontentslangsextension.*,tblproducts.defaultPicID AS defaultPicID, totalPriceInUserCurrency-(discount/100*totalPriceInUserCurrency) AS totalPriceInUserCurrency, tblcustomersordersitemsextension.*, (select sum(totalPriceInUserCurrency) from tblcustomersordersitems c where orderID=tblcustomersordersitems.orderID and c.grouped=tblcustomersordersitems.grouped) as groupedTotal, (select count(1) from tblcustomersordersitems d where orderID=tblcustomersordersitems.orderID and d.grouped=tblcustomersordersitems.grouped) as groupedCount, tblcustomersordersitems.id as orderItemID, (select langContentID from tblweights where id=tblproductsitems.weightID) as weightLang FROM tblcustomersordersitems INNER JOIN tblproductsitems ON tblproductsitems.id=tblcustomersordersitems.lineItemID INNER JOIN tblproducts ON tblproducts.id=tblproductsitems.productID LEFT JOIN tblproductscontentslangs ON (tblproducts.id=tblproductscontentslangs.productID AND tblproductscontentslangs.sectionID=1) LEFT JOIN tblproductscontentslangsextension ON (tblproducts.id=tblproductscontentslangsextension.productID AND tblproductscontentslangsextension.sectionID=1) INNER JOIN tblcurrency ON tblcurrency.id=tblcustomersordersitems.currency LEFT JOIN tblcustomersordersitemsextension ON tblcustomersordersitemsextension.orderItemID=tblcustomersordersitems.id WHERE orderID=0