Answers for "psql count"

SQL
1

order by count postgres

select 
    count(w.id) as mycount,
    w.company_id,
    c.company_name,
    c.city
from 
    companies c 
    left join workers w on 
        c.id=w.company_id 
group by 
    w.company_id,
    c.company_name,
    c.city
order by mycount desc;
Posted by: Guest on April-27-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language