We use the MIN () function to determine the smallest amount or number in a column. While there may be more than one row with the smallest number, only one row will be returned.
Select MIN (MonthsWithOwner) AS LeastTimeWithOwner FROM Cat;
(1 row(s) affected)
Want to follow along on your own database?
Do you want to follow along with the examples? We have created a sample database you can use to follow along and try in your own database. Go to the download page and follow the instructions. Have fun on the SQL trail!