-
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?
-
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?
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|