M Vishnu vardhan Posted December 5, 2019 Share Posted December 5, 2019 What is the logics of both MIN() and MAX() operations, it is showing wrong results I think. Can you explain it briefly. This is the link of that operations. https://www.w3schools.com/sql/sql_min_max.asp Link to comment Share on other sites More sharing options...
Funce Posted December 5, 2019 Share Posted December 5, 2019 What do you expect it to show? Link to comment Share on other sites More sharing options...
Makwana Prahlad Posted December 9, 2019 Share Posted December 9, 2019 Hello, @M Vishnu vardhan MIN() function : The MIN() function returns the smallest value in the specified table field(column). For example, let's suppose we want to know the year in which the oldest movie in our library was released, we can use MySQL's MIN() function to get the desired information. SELECT MIN(`year_released`) FROM `movies`; Execute above query in MySQL the output look like that : MIN('year_released') 2005 MAX() function : The MAX() function is the opposite of the MIN() function. It returns the largest value from the specified table field(column). Let's assume we want to get the year that the latest movie in our database was released. We can easily use the MAX() function to achieve that. SELECT MAX(`year_released`) FROM `movies`; Execute above query in MySQL the return output look like that : MAX('year_released') 2019 I hope above information will be useful for you. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now