I am trying to compare two fields of the same table, the fields names are 'start' and 'end'. For both start and end fields I have values 00 to 23 stored. for example
----------------
| start|end|name
===============
00 00 a
01 01 b
02 02 b
03 03 w
. .
. .
23 23 v
so what I am looking is that i needs to compare the start and end fields and choose the corresponding name.
For example,
if customer chooses start as 01 and end as 10, then I needs to list all the name in between this values.
How can I do it in MySQL Query?
Maybe I didnt understand it so good but sounds like should try something like this
SELECT name FROM your_table WHERE( start >= RANGE1 AND end <= RANGE2)
This will do it
select * from stuff
where start>= '01'
and end <= '03'