Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is my actual query but it's just displaying column names but I need field values over there as well, what I am missing in the query?
Can you check?


SQL
select [sec_umrf_details].mrfno_nu, [sec_modules].modname_vc, 
	   [sec_roles].rolename_vc, [sec_functions].functionname_vc

from   [sec_umrf_details]

join	[sec_mrf_details] on [sec_umrf_details].mrfno_nu = [sec_mrf_details].mrfno_nu
join	[sec_modules] on [sec_mrf_details].modid_int = [sec_modules].modid_int
join	[sec_roles] on [sec_mrf_details].roleid_int = [sec_roles].roleid_int
join	[sec_functions] on [sec_mrf_details].fnid_int = [sec_functions].fnid_int


Where [sec_umrf_details].userid_vc = 'iagsa'
Posted
Updated 17-Aug-11 21:55pm
v2

1 solution

Basically, no we can't.

The data returned depends on so many things: Do you have any entires where sec_umrf_details.userid_vc is iagsa? What about the other joined data? Does it all exist?

Run this query directly in SQL Server Management studio, and take off the WHILE condition. Do you get data?
If not, take out a JOIN. Try again. Repeat.

Sorry, but without your data we are just whistling against the dark. (And that isn't a hint for you to try to show us your whole database)
 
Share this answer
 
Comments
kami124 18-Aug-11 4:07am    
ya i check all the values are there
i am running the querry diredt in sql server Managemnet atudio
kami124 18-Aug-11 4:54am    
now i make changes

select distinct sec_umrf_details.mrfno_int, sec_modules.modname_vc,
sec_roles.rolename_vc, sec_functions.functionname_vc

FROM GCERP_SEC.dbo.sec_umrf_details

left join sec_mrf_details on sec_mrf_details.mrfno_nu = sec_umrf_details.mrfno_int
left join sec_modules on sec_modules.modid_int = sec_mrf_details.modid_int
left join sec_roles on sec_roles.roleid_int = sec_mrf_details.roleid_int
left join sec_functions on sec_functions.fnid_int = sec_mrf_details.fnid_int

where sec_umrf_details.userid_vc = 'igasa'

the result is showing on mrfno_int and all other s showing null

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