This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"bool": { | |
"should": [ | |
{ | |
"match": { | |
"criteria.criteriaId": "7IC1m5neYb3RicUIrmUV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
YEAR(stock_status_histories.created_at) as year, | |
MONTH(stock_status_histories.created_at) as month, | |
-- Total IGOR Amount Dresses | |
CAST(SUM( | |
CASE | |
WHEN manufacturers.id = 1 AND products.type = 'wedding_dress' OR products.type = 'evening_dress' THEN IFNULL(stock_payment_items.amount / 100, 0) | |
ELSE 0 | |
END |