Completed

Help with Mysql query

This query working

SELECT DATE_FORMAT(oo.date_added, '%m/%d/%Y') as Date, ot.order_id, round([login to view URL],2) as total, round(SUM([login to view URL]*[login to view URL]),2) AS weight, round(SUM([login to view URL]*p.cost_sk),2) AS product_cost,

(Select round(SUM([login to view URL]),2) from oc_order_total ot1 where [login to view URL] like 'tax' and ot1.order_id = oo.order_id) as tax,

(Select round(SUM([login to view URL])*-1,2) from oc_order_total ot2 where [login to view URL] like 'ultimate_coupons' and ot2.order_id = oo.order_id) as sconto,

(Select round(SUM([login to view URL]),2) from oc_order_total ot3 where [login to view URL] like 'low_order_fee' and ot3.order_id = oo.order_id) as low_order_fee,

(Select round(SUM([login to view URL]),2) from oc_order_total ot4 where [login to view URL] like 'category_product_based_fee' and ot4.order_id = oo.order_id) as isotermico,

(Select round(SUM([login to view URL])*-1,2) from oc_order_total ot5 where [login to view URL] like 'redeem_point' and ot5.order_id = oo.order_id) as points,

(Select round(SUM([login to view URL]),2) from oc_order_total ot6 where [login to view URL] like 'suppcontr' and ot6.order_id = oo.order_id) as contrassegno,

(Select [login to view URL] from oc_order_total ot7 where [login to view URL] like 'ultimate_coupons' and ot7.order_id = oo.order_id group by ot7.order_id) as sconto_title,

(Select round(SUM([login to view URL]),2) from oc_order_total ot8 where [login to view URL] like 'sub_total' and ot8.order_id = oo.order_id group by ot8.order_id) as subtotal,

(Select [login to view URL] from oc_order_total ot9 where [login to view URL] like 'shipping' and ot9.order_id = oo.order_id group by ot9.order_id) as shipping_name, [login to view URL] as affiliateFee,

(Select round(SUM([login to view URL]),2) from oc_order_total ot10 where [login to view URL] like 'shipping' and ot10.order_id = oo.order_id) as shipping_cost

FROM oc_order_total ot

INNER JOIN oc_order oo on ot.order_id = oo.order_id

INNER JOIN oc_order_product op on op.order_id = ot.order_id

INNER JOIN oc_product p on op.product_id = p.product_id

LEFT JOIN oc_affiliate_transaction oat on oat.order_id = ot.order_id

WHERE oo.store_name = 'test'

AND oo.order_status_id != 0

AND oo.date_added BETWEEN '2018-08-10' AND '2018-08-25'

GROUP BY ot.order_id

ORDER BY ot.order_total_id DESC

but i'm getting a wrong data for these due fields

'product_cost' and 'weight'

Could you help me to fix? i can not send u the db due of privacy issues, but i can send u structure table

Skills: MySQL

See more: mysql query syntax, sql live help, how to run query in mysql workbench, mysql select limit, mysql tutorial, how to open query window in mysql workbench, mysql queries, mysql experts online, edit csv mysql query, outsource help mysql database, asp mysql query, 2013 lost connection mysql query, mysql query report, php mysql query table, mysql query record bash, mysql query csv file, write mysql query, optimize mysql query software, mysql query php table css, php mysql query format table

About the Employer:
( 143 reviews ) Villanova Mondovì, Italy

Project ID: #17859882

Awarded to:

nrislam10

Hi I think i can solve your query problem. I can start immediately. Please send me the table to start immediately. With best regards.

€15 EUR in 1 day
(0 Reviews)
0.0

11 freelancers are bidding on average €23 for this job

vikrant12112

Hello, After reviewing your project, I’d love to discuss in more detail with you to ultimately understand your needs more. Relevant Skills and Experience I have more than 3 years of professional experience in P More

€12 EUR in 1 day
(9 Reviews)
4.7
letshappy

please send me table structure so that i can fix the issue and i can understand that u cant share access bcz of privacy

€39 EUR in 1 day
(17 Reviews)
5.2
roshanasim

I have the ability to create back-end code that will add utility to everything the front-end designer creates. I'm passionate about the impact my skills can have in the real world, and firmly believe that I can creat More

€25 EUR in 1 day
(11 Reviews)
4.3
yujun21

Hello! I am expert in MySQL. I am prepared to complete your task with excellent quality, on time............. Once you take me, I am sure you will get the best quality you have ever seen...................... I woul More

€25 EUR in 0 days
(15 Reviews)
4.1
rrgindore

Dear sir I am mysql expert with an exposure to joins etc please initiate further for better understanding

€19 EUR in 1 day
(16 Reviews)
4.0
€34 EUR in 3 days
(1 Review)
2.0
rahulonwrk

Greeting for the Day! I am a full time freelancer and will devote entire time to your project and deliver the best client satisfaction through my perfection in this field at very reasonable cost. I believe that More

€12 EUR in 1 day
(0 Reviews)
0.0
skfaroo123

Hi there I can do it asap and help you right now Please contact me and send me relative tables I am looking forward to your reply Regards

€30 EUR in 1 day
(0 Reviews)
0.0
€29 EUR in 2 days
(0 Reviews)
0.0
kalpinfotech8

Dear Sir/Madame I have Been a Graphic Designer ,WebSite Designer and Developer for More than 4+ Years Experience , I am Very Much Interested In this work Please Check My Portfolio Page for my work. I More

€18 EUR in 3 days
(0 Reviews)
0.0