Wednesday, 21 August 2013

how to search with max and min on two fields mysql?

how to search with max and min on two fields mysql?

i have this table(MySQL):
|id|min|max|info|
+--+---+---+----+
|1 |18 |24 | ...|
+--+---+---+----+
|2 |22 |26 | ...|
SQL:
SELECT * FROM myTable WHERE max <= 21 AND min >= 21
Result: None

No comments:

Post a Comment