Use the result of the MySQL SELECT query as a WHERE condition in the same query -


I am trying to query this:

  SELECT MAX (`peg_num`) ) `List_ID` = 1 and" indicator "& gt; = 1  

, but I'm getting the result of NULL . The peg_num range is from 00 to 99, what do I need 99 .

The value to be checked against the "indicator" should actually be one user input, so I want to be versatile, but if I flip around equality, then

/ P>

As I have suggested, using the Mowing section, m ... but I have now cheated the aliens now anyway. :

  SELECT MAX ( `peg_num`) as Men` indicator 'as` list' group Se` Suchi_aidi` maximum MAX ( `Peg_anyuem`) & lt; = 40  

Still very stubborn. <99 p>

As a comprehension:

What I want is to select the largest value in the range of query peg_num, but only if it is larger than the input given by the user. So, in this case, there is a maximum of 99. If a user wants to select a number like 101, then he / she can not do this because it is not in the range.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -