Jump to content

get greatest number in db


jwk811

Recommended Posts

You would add to the end of your call 'ORDER BY cell DESC LIMIT 1'

 

As an example I have 1 table named 'Table1' with 2 cells 'Cell1' and 'Cell2'

 

-------------------------------------

|                  Table 1                      |

-------------------------------------

|      Cell1          |        Cell2        |

--------------------------------------

|  Bob                |    22                  |

|  George            |    33                |

|  William            |    21                  |

--------------------------------------

 

To find the Highest number my SQL call would be the following

 

"SELECT Cell2 FROM Table1 ORDER BY Cell2 DESC LIMIT 1;"

 

would return '33'

 

Hope that helps,

Lachild

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.