Question: I have two `p:selectOneMenu`, one is Zone and other is District, if District is selected then it should automatically select the respective Zone, Both Zone and District are loaded from database table and District table contains Zone\_id. i.e. Zone is accessible from District using zone\_id.

Both Zone and District are loaded when the form is loaded.
How to implement this function in `Primefaces` ? I have done same stuff in Java but not in Primefaces.

Answer: 
```
select price  from table1 where FromDate >='2013-12-15' and  
ToDate <='2013-12-15'

```

This will produce your expected result without using `between` condition. but both will do the same operation
I understand correctly and you want to select rows with periods that overlap with your search period then `BETWEEN` itself has nothing to do with your problem. You can try it this way

```sql
SELECT *
  FROM table1
 WHERE ('2013-12-15' >= fromdate 
   AND  '2013-12-15' <= todate)
    OR ('2013-12-29' >= fromdate 
   AND  '2013-12-29' <= todate)

```

or 

```sql
SELECT *
  FROM table1
 WHERE '2013-12-15' BETWEEN fromdate AND todate
    OR '2013-12-29' BETWEEN fromdate AND todate

```

Here is **[SQLFiddle](http://sqlfiddle.com/#!2/6d674/2)** demo