i have two different tables
table1 - property
=================
id,name, address, city state, zip
table2 - floorvalue
===================
id, rentmin, rentmax, bedrooms, bathrooms
i need a query to fetch min rent values from the two tables, the current below query getting for eg two records with all the values like property id, name, city, state and then floor id, rmin, rmax etc. but i need the first minimum rent if i get two or more records of the same id.
query i have :
select
p.id,
p.name,
p.address,
p.city,
p.state,
p.zip,
f.id,
f.rmin,
f.rmax,
f.bedrooms,
f.bathrooms
from property as p, floorvalue as f
where p.city = 'losangeles' and p.state = 'ca' and p.id = f.id
this will show the values related to the apartment whose minimum rent is minimal among tables. i hope this is what you need.