title: MySQL searching two tables for price
body: <p>I m having trouble writing a query, I have two tables. </p>
  
  <ol>
  <li><p>Property Table (property)</p>
  
  <ul>
  <li>id   </li>
  <li>property_name</li>
  <li>property_type   </li>
  <li>price</li>
  </ul></li>
  </ol>
  
  <p>there are two types of property, commercial or residential. If type is residential the price is for whole property. But if the type is commercial, each flat have different prices, like Ground Floor, 1st floor, 2nd floor, 3rd floor. and so on. So i made a second table</p>
  
  <ol>
  <li><p>Property Price Table (price_for_commerical_prop)
  which has following fields</p>
  
  <ul>
  <li>id</li>
  <li>property_id</li>
  <li>floor_id</li>
  <li>price</li>
  </ul></li>
  </ol>
  
  <p>this table may contain multiple row for one property, depending upon the number of flats the property has. floor_id contains value 0 for ground floor, 1 for 1st floor and so on.</p>
  
  <p>My problem is that. I have a search field to search property based on price. So If user enters price, i have to search price in price field of 1st table as well as 2nd table. And return the rows based on the search criteria. Can anybody shed light on how to do this?</p>