I have two queries I'd like to combine - and the json is kicking my butt.
The json extract below pulls a sku out of a lookup table along with the quantity ordered {"9999":2} It works fine.
If I add the 3 commented out portions, I get no results.
SELECT
`p`.`id`,
`p`.`sku`...
The second table, base_order_shipments shows ALL shipments for each day, not just those that were received and Fully shipped on that same given day.
For example, if an order was received outside of the range, and was unable to be shipped because the merch was out of stock... it could be...
I had such high hopes, but I'm still missing *something*
If I remove the comment indicator before the "and" in the JOIN I still get the same results.
It seems I have to keep the date in the join or I lose days, and the figures are not right. If I count(base_order_id) it's not available as a...
Yes, there absolutely is... and it is the base_order_id. I was thinking I'd run into trouble because if there is no shipment there's no base_order_id entry in the table, but that is essentially the same problem I caused for myself using the date! Thank you again. I didn't put this in the...
I also tried to put a condition on that count tried 0 and null, but still no chg
FROM
(SELECT
DATE(completed) AS compdate, IF(COUNT(id) IS NULL,0,count(id)) AS 'totalshipped'
FROM
base_order_shipments
WHERE
DATE(completed) BETWEEN '2018-12-01' AND...
I found an example online that I was able to understand and convert, and I just have one issue I cannot seem to overcome now....
there were two days where no shipments were made at all, 12-2 and 12-9, how can i get the orders received on those two days to appear, even though there were 0...
Here's the logic I am atempting to apply
Have a base_orders table. It contains order_date and completed (shipped)
The first part is I needed to know the number of orders that were received and shipped out on the same day, for a range of days (a week for example)
Someone was nice enough to...
I just knew I was making it harder than it had to be.
I had to tweak that a tiny bit for mysql, but that's definitely got it. THANK YOU!
Now I'm off to add a "shipments" table to get the grand total of shipments for each day, regardless of the order date, which I know is going to be a...
subqueries with multiple date results
I am building a query that shows the number of orders received, on each date within a range of dates
Wanted: a 2nd column of orders that were shipped in full on the same day they were received.
this is what I have so far, and the results of orders in...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.