{"action":"opened","issue":{"url":"https://api.github.com/repos/NetVaIT/delphi-standard/issues/4","labels_url":"https://api.github.com/repos/NetVaIT/delphi-standard/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/NetVaIT/delphi-standard/issues/4/comments","events_url":"https://api.github.com/repos/NetVaIT/delphi-standard/issues/4/events","html_url":"https://github.com/NetVaIT/delphi-standard/issues/4","id":103801924,"number":4,"title":"Se repiten las personas cuando tienen mas de un rol","user":{"login":"jhuante","id":4365813,"avatar_url":"https://avatars.githubusercontent.com/u/4365813?v=3","gravatar_id":"","url":"https://api.github.com/users/jhuante","html_url":"https://github.com/jhuante","followers_url":"https://api.github.com/users/jhuante/followers","following_url":"https://api.github.com/users/jhuante/following{/other_user}","gists_url":"https://api.github.com/users/jhuante/gists{/gist_id}","starred_url":"https://api.github.com/users/jhuante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhuante/subscriptions","organizations_url":"https://api.github.com/users/jhuante/orgs","repos_url":"https://api.github.com/users/jhuante/repos","events_url":"https://api.github.com/users/jhuante/events{/privacy}","received_events_url":"https://api.github.com/users/jhuante/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NetVaIT/delphi-standard/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"jcramirez79","id":14018789,"avatar_url":"https://avatars.githubusercontent.com/u/14018789?v=3","gravatar_id":"","url":"https://api.github.com/users/jcramirez79","html_url":"https://github.com/jcramirez79","followers_url":"https://api.github.com/users/jcramirez79/followers","following_url":"https://api.github.com/users/jcramirez79/following{/other_user}","gists_url":"https://api.github.com/users/jcramirez79/gists{/gist_id}","starred_url":"https://api.github.com/users/jcramirez79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcramirez79/subscriptions","organizations_url":"https://api.github.com/users/jcramirez79/orgs","repos_url":"https://api.github.com/users/jcramirez79/repos","events_url":"https://api.github.com/users/jcramirez79/events{/privacy}","received_events_url":"https://api.github.com/users/jcramirez79/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-08-28T21:52:16Z","updated_at":"2015-08-28T21:52:16Z","closed_at":null,"body":"Encontre que el query principal tiene realacion con personas roles, que es lo que genera que exista mas de uno en perosnas, debido a que necesitas filtrar por IdRolTipo, puedes evitarlo con el siguiente cambio:\r\n\r\nSELECT IdPersona, RFC, CURP, IdPersonaTipo, IdRazonSocialTipo, IdSexo, IdEstadoCivil, IdPais, IdPoblacion, \r\nRazonSocial, Nombre, ApellidoPaterno, ApellidoMaterno, FechaNacimiento, LugarNacimiento, IdPersonaTitular, VigenciaFM34\r\nFROM Personas\r\nWHERE (IdPersona IN\r\n(SELECT IdPersona FROM PersonasRoles WHERE IdRol IN\r\n\t(SELECT IdRol FROM Roles WHERE IdRolTipo = 2)))\r\n\r\nSolo habra que implementarlo para los diferentes casos, posiblemente con un parametro en el query\r\n\t\t\t   \r\n\r\n"}}