varsql="select *, id as account, id as group, (select count(*) as childs from cmdb.ci child where child.parent_id = parent.id and family_id <> 14) as childs ";//14 = IT-Tjänstekomponent Access med grupper och konton
sql+="from cmdb.ci parent ";
sql+="where parent.id = $1 and family_id <> 14";
sql+="order by family_type_id, family_id, display_name";