Skip to content

EgorZhizhlo/MillionAgentsTask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Задание

image

image

Запуск

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

image

Решение

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;

image

Решение:

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;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published