Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
here in my code
sec_umfr_details is table 1 having userid_vc,mrfno_nu
sec_mrf_details is table 2 having mrfno_nu and fnid_int

i have userid_vc and mrfno_nu and
i have to display fnid
Posted
Updated 28-Jul-11 0:38am
v2

SQL
SELECT 
	sec_mrf_details.fnid_int
FROM sec_umfr_details INNER JOIN sec_mrf_details
	sec_umfr_details.mrfno_nu = sec_mrf_details.mrfno_nu
WHERE
	sec_umfr_details.mrfno_nu = 'whatever'
	AND sec_mrf_details.userid_vc  = 'again whatever'


you should consider looking JOINS[^]
 
Share this answer
 
v2
Comments
kami124 28-Jul-11 7:02am    
same thin i have done but still

select sec_mrf_details.fnid_int
from sec_umrf_details
inner join
sec_mrf_details
on
sec_umrf_details.mrfno_nu = sec_mrf_details.mrfno_nu
where
sec_umrf_details.userid_vc='i-jadoon'
and
sec_umrf_details.mrfno_nu=1
Manas Bhardwaj 28-Jul-11 7:08am    
that means you have not data matching this condition.
Join the two tables on mrfno_nu and select fnid from the query.
 
Share this answer
 
Have a look at the last question you posted

querry to get information about user[^]

The examples there should show you how to create a JOIN on your tables so you can retrieve the data you want.

Try and create an SQL statement to do this, if you have a problem then post back what you don't understand

This is really quite simple, you can figure it out yourself if you look at the previous question :)
 
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