Using a Range Function in a select clause?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Using a Range Function in a select clause?

Hybrid View

  1. #1
    dbell Guest

    Using a Range Function in a select clause?


    Does anyone know how to use a range function in a select clause. I would
    like to select where the values in a range between the values of two columns
    fall within a range provided in the where clause?

  2. #2
    Tonny H Guest

    Re: Using a Range Function in a select clause?


    you meant
    select * from table1 where id between 1 and 10


    "dbell" <dbell@geoin.com> wrote:
    >
    >Does anyone know how to use a range function in a select clause. I would
    >like to select where the values in a range between the values of two columns
    >fall within a range provided in the where clause?



  3. #3
    Dave Bell Guest

    Re: Using a Range Function in a select clause?


    Actually, I am trying to work with geographic coordinates. The database has
    four columns which correspond to the corners of a space on the ground. A
    user will provide me with a space they are interested in and I want to pull
    the intersecting spaces records.

    So, for example, I want to check to see if the range of values between the
    north and south extents of the user's space intersect the range of values
    between the north and south extents of records in the database. Then I
    would do the same for east and west and viola! get the intersecting records.

    Unfortunatly, I did not see a range function in ANSI SQL. If there were,
    I would simply say
    select * from table
    where Range('userX', 'userY') intersect Range(north, south)

    I am using SQL Server, so Transact SQL functions could be used. I am also
    willing to switch to Oracle, Informix, or whatever supports the range functions
    I need.

    Any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center