How to find a range of given number?

Seehyung Lee

I have a table like below and I want to find the range of inputted number. ex) if users enters 84, MySql query returns B.

Rank  Range_Start Range_End
A       90          100
B       80          89
C       70          79
.
.
H
I        0          10
Sylvain Leroux

What about:

SELECT Rank FROM tbl WHERE Range_Start < my_value AND Range_End > my_value

Or (if you don't need strict inclusion):

SELECT Rank FROM tbl WHERE my_value BETWEEN Range_Start AND Range_End

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to find number that's divisible by a number in a given range?

From Dev

How to find number of integers in a given range has even set bits

From Dev

How to find the top number between a range given a value from a table using LINQ

From Dev

How to iterate from a given number range?

From Dev

How to SUM the number of duplicates in a range by given value?

From Java

How to find the number that best matches a given number

From Dev

How to find date range for a given week on Android?

From Dev

How to find if a string is in range of a given string

From Dev

How to find date range for a given week on Android?

From Dev

How to find the given date is with in specified date range

From Dev

MySQL - Find number of days in date range which fall in a given month

From Dev

Scale a number by given range

From Dev

How to find index of a given Fibonacci number

From Dev

How to find a value in an array that is closest to a given number

From Dev

How to find largest sequence of a given number in excel?

From Dev

How to find number of Subdirectories under a given directory

From Dev

How to find prime numbers in entered number range

From Dev

How to look up range from set of contiguous ranges for given number

From Dev

How to use grep to return lines with an hexadecimal number in a given range?

From Dev

how to find the minimum number of primatics that sum to a given number

From Dev

how to find the output for a file if head number and tail number is given

From Dev

How to find objects created within given date range?

From Dev

How to find missing time value(s) in a given range in MySQL database?

From Dev

Find if given number is prime or not

From Dev

Find all slots in a given range

From Dev

find endpoints for range given a value within the range

From Dev

What data structure to find number of elements in a given range in O(log n) time?

From Dev

Given a port number, how to use netstat to find the connection detail?

From Dev

Given a set of intervals, how to find the maximum number of intersections among them,

Related Related

  1. 1

    how to find number that's divisible by a number in a given range?

  2. 2

    How to find number of integers in a given range has even set bits

  3. 3

    How to find the top number between a range given a value from a table using LINQ

  4. 4

    How to iterate from a given number range?

  5. 5

    How to SUM the number of duplicates in a range by given value?

  6. 6

    How to find the number that best matches a given number

  7. 7

    How to find date range for a given week on Android?

  8. 8

    How to find if a string is in range of a given string

  9. 9

    How to find date range for a given week on Android?

  10. 10

    How to find the given date is with in specified date range

  11. 11

    MySQL - Find number of days in date range which fall in a given month

  12. 12

    Scale a number by given range

  13. 13

    How to find index of a given Fibonacci number

  14. 14

    How to find a value in an array that is closest to a given number

  15. 15

    How to find largest sequence of a given number in excel?

  16. 16

    How to find number of Subdirectories under a given directory

  17. 17

    How to find prime numbers in entered number range

  18. 18

    How to look up range from set of contiguous ranges for given number

  19. 19

    How to use grep to return lines with an hexadecimal number in a given range?

  20. 20

    how to find the minimum number of primatics that sum to a given number

  21. 21

    how to find the output for a file if head number and tail number is given

  22. 22

    How to find objects created within given date range?

  23. 23

    How to find missing time value(s) in a given range in MySQL database?

  24. 24

    Find if given number is prime or not

  25. 25

    Find all slots in a given range

  26. 26

    find endpoints for range given a value within the range

  27. 27

    What data structure to find number of elements in a given range in O(log n) time?

  28. 28

    Given a port number, how to use netstat to find the connection detail?

  29. 29

    Given a set of intervals, how to find the maximum number of intersections among them,

HotTag

Archive