}
else {
$sql = '
- SELECT p.id_permiso, p.desc_permiso, count(ps.id_sistema) AS cuenta
+ SELECT p.id_permiso, p.desc_permiso, NOT count(ps.id_sistema) AS cuenta
FROM samurai.permiso AS p
LEFT JOIN samurai.perm_sist AS ps
ON (p.id_permiso = ps.id_permiso)