SELECT AVG(`age`)
FROM `CUSTOMER`
WHERE `CUSTOMER_KEY` IN (
SELECT `CUSTOMER_KEY`
FROM `PURCHACE`
WHERE `PRODUCT_KEY` IN (
SELECT `PRODUCT_KEY`
FROM `PRODUCT`
WHERE `NAME` = 'плюшевый мишка'
) AND `DATE` BETWEEN '2018-01-01' AND '2018-12-31'
)
SELECT AVG(`age`)
FROM (
SELECT DISTINCT `c`.`CUSTOMER_KEY`, `c`.`AGE` AS `age`
FROM `PRODUCT` AS `p`
JOIN `PURCHACE` AS `pu`
ON `p`.`NAME` = 'плюшевый мишка'
AND `pu`.`DATE` BETWEEN '2018-01-01' AND '2018-12-31'
AND `pu`.`PRODUCT_KEY` = `p`.`PRODUCT_KEY`
JOIN `CUSTOMER` AS `c`
ON `c`.`CUSTOMER_KEY` = `pu`.`CUSTOMER_KEY`
) AS `t`
Данный модуль устарел, начиная с версии PHP 5.5.0, и удалён в PHP 7.0.0. Используйте вместо него MySQLi или PDO_MySQL.https://www.php.net/manual/ru/function.mysql-conne...
Windows 95 will fail to boot if you have more than around 480MB of memory.https://devblogs.microsoft.com/oldnewthing/2003081...
<percentage>
The percentage is calculated with respect to the width of the generated box's containing block. Note that this is true for 'margin-top' and 'margin-bottom' as well. If the containing block's width depends on this element, then the resulting layout is undefined in CSS 2.1.
Percentages: refer to logical width of containing block
SELECT `recipe_id`, `ingredient_id`
FROM `recipe_ingredients`
WHERE `ingredient_id` IN (501, 900)
SELECT `recipe_id`, COUNT(*) AS `count`,
SUM(`ingredient_id` IN (501, 900)) AS `avail`
FROM `recipe_ingredients`
GROUP BY `recipe_id`
HAVING `count` = `avail`