Jump to content

Is this correct for SQL MAX()

Recommended Posts

In working the "Try It Yourself" demo for the SQL MAX() command, the result does not make sense to me! Can someone help explain how the demonstrator came up with that result?

Edited by Cockroach
Link to post
Share on other sites

That code is running in your browser, these days there is a way to create an actual database in your browser, so it's your browser that is running that code on the database that the site created.  You can see the list of tables in the database on the right side of the screen in the Try It editor.

It has this as the query that it's running:

SELECT MAX(Price) AS HighestPrice FROM Products;

And the result is 263.5.  Since it is selecting from the Products table, if you click on the Products table on the right side of the screen then it will list all 77 records in that table, and if you scroll through that table you'll find that the highest price is 263.5 for the product called Côte de Blaye.

Link to post
Share on other sites

Ahhhhhh! Now I understand how this trainer works. On the previous page it only listed 5 items, top amount is 25! But there are other items in that database, you just have to know how to find them! Now, I do! Thank you so much!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...