Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

i have a "register_master" table which have a user's "Height" field
and "partner_master" table have a "HeightFrom" and "HeightTo" fields

register_master
----------------
reg_id
height

partner_master
--------------
partner_id
reg_id
heightfrom
heightto

values inserted in these fields as (4 feet, 4feet 1inch, 5feet 2inch ,7feet 4inch)

i want sql query for matching partner with height

register master;s id find height from partnermaster's heightfrom to heightto

how to write query
Posted
Comments
ZurdoDev 11-Mar-14 7:23am    
Where are you stuck?
Are the heights entered as strings?

1 solution

Try this
Also understand that this is just a sample query..You can let me know if there is any issue..and also you can develop from this here on..
SQL
Select Partner_ID from Partner_Master pm INNER JOIN Register_Master rm on pm.Reg_ID=rm.Reg_Id
Where rm.Height between pm.HeightFrom and pm.HeightTo
 
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