Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi to all!

here i create querry i am getting the correct result but the problem here is that record display multiples times


SQL
ALTER procedure [dbo].[proc_function_role_module] (@mid int, @rid int)
   as
   SELECT distinct sec_functions.functionname_vc 
       
   FROM [GCERP_SEC].[dbo].[sec_mrf_details] 

join sec_modules on sec_modules.modid_int = sec_mrf_details.modid_int
join sec_roles on sec_roles.roleid_int = sec_mrf_details.roleid_int
join sec_functions on sec_functions.fnid_int = sec_mrf_details.fnid_int
  
   where  sec_modules.modid_int = @mid and sec_roles.roleid_int= @rid
Posted
Updated 28-Aug-11 1:22am
v2
Comments
Shahan Ayyub 28-Aug-11 8:37am    
could you please provide more information? samples?

1 solution

perhaps resulting sec_functions.functionname_vc is not really unique, i.e. one with trailing spaces another without...
or maybe change the "join" to "inner join"?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900