Posts by Daniel Machado Maffioletti • 1 point
1 post
-
0
votes2
answers74
viewsA: SQL query, count the amount of existing values of a Foreign Key for each corresponding Primary Key in 1 query
Need to make a INNER JOIN between the tables... Try like this... SELECT a.id_admin, a.email, a.password, COUNT(b.admin_id_admin) AS count_news FROM admin a INNER JOIN news b on b.admin_id_admin =…