Answer the question
In order to leave comments, you need to log in
What is wrong with my request?
Hello. I need to know the number of related records in two tables. I got the following query:
select
main.id
count(news.id) as news,
count(articles.id) as articles
from main
LEFT JOIN news ON main.id = news.main_id
LEFT JOIN articles ON articles.id = articles.main_id
group by main.id
order by news desc;
news
and articles
multiplied by each other. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question