git clone https://github.com/EgorZhizhlo/MillionAgentsTask.git
cd MillionAgentsTask
docker build -t converter .
docker run -d -p 8000:8000/tcp converter
Сайт будет доступен по адрессу http://localhost:8000
SELECT
user_id,
SUM(CASE WHEN EXTRACT(YEAR FROM created_at) = 2022 THEN reward ELSE 0 END) AS reward_sum_2022
FROM
reports
GROUP BY
user_id
HAVING
MIN(EXTRACT(YEAR FROM created_at)) = 2021;
SELECT
r.barcode,
r.price
FROM
reports r
JOIN
pos p ON r.pos_id = p.id
GROUP BY
r.barcode, r.price
HAVING
COUNT(DISTINCT p.title) > 1;