SQL error: Column 'usr_id' in from clause is ambiguous
SELECT usr.* , COUNT(DISTINCT apu.apu_id) AS apu_count, MAX(apu.apu_publicado) AS apu_fecha , COUNT(DISTINCT com.com_id) AS com_count FROM bitacora_usuarios usr INNER JOIN bitacora_apuntes apu ON apu.usr_id = usr.usr_id AND apu.apu_publicado > 0 LEFT JOIN bitacora_comentarios com USING(usr_id) GROUP BY usr.usr_id ORDER BY usr.usr_alias ASC