Select a value depending on the chosen footage

Asked

Viewed 21 times

1

I need to return the value of a product according to the chosen footage, this value is saved in a table this way

de_mt | ate_mt | valor_mt
--------------------------
  1   |   5    |  15.00
  6   |   8    |  16.00
  9   |   15   |  16.50

These values are entered by admin, and the user only puts the footage.

Let’s say the user enters 7 the system would have to bring the value of 16.00

I’ve tried to (I know it wouldn’t have been logical, but it was just an attempt)

SELECT * FROM valor_metro WHERE de_mt >= '7' AND  ate_mt <= '7'

And also with BETWEEN But it came to nothing.

1 answer

2


  • Thank you, really was trying the wrong way, thanks for the help

Browser other questions tagged

You are not signed in. Login or sign up in order to post.