Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all!

I have five tables:
SQL
umrf
mrf
mod
fun
rol

 fields of each tables are as

umrf={umrfid, uid, mrfid(FK)}

mrf = (mrfid(PK), modid(FK), rolid(FK), fnid(FK))

mod = {modid(PK), modname}

rolid = {rolid(PK), rolname}

mod = {modid(PK), fnname}



The given is:

uid

and I have to display field values of:

mrfid, modname, rolname, fnname


How to do this? I have try many times.
Posted
Updated 18-Aug-11 0:48am
v3

SQL
SELECT 
MR.MRFID,MO.Modname, RL.Rolname, FN.Fnname
FROM UMRF U 
INNER JOIN MRF MR ON U.MRFID=MR.MRFID
INNER JOIN MOD MO ON MR.MODID=MO.MODID
INNER JOIN FUN FN ON MR.FNID=FN.FNID
INNER JOIN ROL RL ON MR.ROLID=RL.ROLID
WHERE U.UID=...
 
Share this answer
 
Comments
kami124 18-Aug-11 7:14am    
ya by this code its diplaying the fields name only

i want the values of field also
Use a set of inner joins[^] to get whatever values you require.
 
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