SQLTeam.com | Weblogs | Forums

How to SELECT MIN value and show all columns?

Hi all,

I just started SQL today :smiley:

I am currently trying, in this test database, to show the minimum value of downloads for an app, but then also have it show all the other information:

At the moment, it only shows MIN(downloads) = 1387

And I have to SELECT * FROM table_name and then ORDER BY downloads ASC in order to see the minimum value

Is there a way in which I can avoid this and just have it display the minimum value column alone?

Thank you all! :slight_smile:

select top 1 * from TableName order by downloads ASC

SELECT MIN(downloads) AS min_downloads FROM dbo.table_name