|
krishna.a -> Query writing SQL (5/2/2007 4:03:26)
|
Hi one help me in writing the query This is the table I have with me. Can one help me in sorting out the query. start_date end_date bus_hol 2007-04-14 2007-05-01 ? 2007-04-03 2007-05-01 2007-11-01 2007-04-18 2007-05-01 2007-11-09 2007-04-01 2007-05-01 2007-09-19 2007-04-02 2007-05-01 2007-09-02 2007-03-29 2007-05-01 2007-08-15 2007-04-04 2007-05-01 2007-11-08 2007-04-07 2007-05-01 2007-12-21 2007-04-17 2007-05-01 ? 2007-04-09 2007-05-01 ? 2007-03-31 2007-05-01 2007-01-26 2007-04-15 2007-05-01 ? 2007-04-10 2007-05-01 ? 2007-04-13 2007-05-01 2007-12-24 2007-04-05 2007-05-01 ? 2007-03-28 2007-05-01 2007-04-06 2007-04-11 2007-05-01 ? 2007-04-12 2007-05-01 ? 2007-03-30 2007-05-01 2007-01-01 2007-04-08 2007-05-01 2007-12-25 2007-04-06 2007-05-01 ? 2007-04-16 2007-05-01 2007-12-31 The output should be as follows. The bus_hol should be between start_date and end_date Start_date end_date count(bus_hol) 2007-04-14 2007-05-01 0 . . . . . . 2007-04-05 2007-05-01 1 (bec 2007-04-06 is betwwen start_ date and end_date) Thanks in Advance krishna
|
|
|
|