J
J
jouserykt2021-01-16 10:49:57
MySQL
jouserykt, 2021-01-16 10:49:57

How to retrieve information from a database?

How to display users aged 25+ for 2020 for each device.
Tell me good people)

60029a6bdb333604247157.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Slava Rozhnev, 2021-01-16
@jouserykt

Your question is not very clear. Therefore, I can assume that one of the following queries will help you:

SELECT 
  device_name,
  COUNT(*) cnt
FROM users
WHERE 
  YEAR(created_date) = 2020 AND
  year_of_birth < DATE_SUB(CURDATE(), INTERVAL 25 YEAR)
GROUP BY device_name;

execute SQL query

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question