Query Formating in SQL/TeraData

oracle India
  • 13 years ago

    HI

    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

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”