Complicated database problem
- From: bilaribilari@xxxxxxxxx
- Date: 15 Jul 2005 04:29:12 -0700
There are two columns in a database table. These two columns are of
type TEXT. They store the FROM and TO values for a certain range. These
values are exceptionally large and cannot be stored as numeric values.
Each range is mutually exclusive and does not overlap. You are free to
add more columns as needed to aid in the solution. I need to write the
following query: Given a String (i.e. a large number) as input, select
the range in which it lies.
Example: This example uses small numbers for clarity.
FROM | TO
----------+---------
100 | 999
1000 | 1999
2000 | 3999
Input: 400
Output:
FROM | TO
---------+-----
100 | 999
Please help me solve this problem.
Thanks in advance.
Best regards.
.
- Follow-Ups:
- Re: Complicated database problem
- From: Paul
- Re: Complicated database problem
- From: --CELKO--
- Re: Complicated database problem
- From: John
- Re: Complicated database problem
- Prev by Date: Re: General Advice on Databases
- Next by Date: Re: Complicated database problem
- Previous by thread: Re: [mysql] MAX and GROUP BY - A possible solution for MySQL
- Next by thread: Re: Complicated database problem
- Index(es):
Relevant Pages
|