Overview
At the most basic level, a single column can be accessed from a SELECT statement. In this circumstance all of the values from the column will be returned from the table. From there you can expand into additional capabilities with the SELECT statement. Let’s take a look at some examples.
Explanation
Let’s start off by referencing the main components of a SELECT statement:
SELECT -- Column names
FROM -- Table or View name
WHERE -- Filter criteria
GROUP BY -- Logic to roll-up records
HAVING -- Criteria for GROUP BY logic
ORDER BY - Sort data either ASC (ascending) or DESC (descending) by column name or position
SQL Server SELECT with Single Column
-- Select first name from dbo.Authors table
SELECT FirstName
FROM dbo.Authors
SQL Server SELECT with Single Column and WHERE Clause
-- Select first name of authors as Jeremy from dbo.Authors table
SELECT FirstName
FROM dbo.Authors
WHERE FirstName = 'Jeremy'
SQL Server SELECT with Single Column, WHERE and ORDER BY Clause
-- Select first name of active authors and return results in ascending order
-- from dbo.Authors table
SELECT FirstName
FROM dbo.Authors
WHERE ActiveFlag = 1
ORDER BY FirstName ASC -- or DESC for descending results
SQL Server SELECT with Data Column and Count, WHERE, GROUP BY and ORDER BY Clause
-- Select first name with the associated count of active authors which also includes
-- grouping the data by first name to roll-up the data and return results in
-- descending order from dbo.Authors table
SELECT FirstName, COUNT(*)
FROM dbo.Authors
WHERE ActiveFlag = 1
GROUP BY FirstName
ORDER BY FirstName DESC
Additional Information
This is just the tip of the iceberg, but a good first step to see how to use the SELECT statement in your applications and reporting.

Jeremy Kadlec is a Founder, Editor and Author at MSSQLTips.com with more than 300 contributions and 25+ years of SQL Server experience. Jeremy leads a team of more than 300 authors helping millions of SQL Server professionals around the globe every second of the day for the last 20 years. He is also the CTO @ Edgewood Solutions and a six-time SQL Server MVP based on his community contributions. Jeremy brings 25+ years of SQL Server DBA and Developer knowledge to the community and holds a bachelor’s degree from SSU and master’s degree from UMBC.


