3

I have a table with three fields id,minvalue and maxvalue.These fields carries multiple values like...

id Minvalue  maxvalue
 1  100        200
 2  201        300
 3  301        400

...and so on. If I supply 250 as input, how can I retrieve its corresponding id using mysql query?

Thanks

1
  • Thank you for edited it for more readability Commented Jul 17, 2010 at 11:08

2 Answers 2

7

This should work:

SELECT * FROM table WHERE 250 BETWEEN maxvalue AND minvalue
Sign up to request clarification or add additional context in comments.

Comments

2
SELECT Id FROM table WHERE 250 BETWEEN MinValue AND MaxValue

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.