Skip to content

Find between which 2 numbers a value lies in MySQL

I have a variable @k=35.

and a table xrf having contents as show below.

How to I get the values in between which @k exist in table xrf.

output is 30 and 40.

Advertisement

Answer

Using conditional aggregation

User contributions licensed under: CC BY-SA
6 People found this is helpful