The SQL Select statement queries a database to return a result as rows of data. In this article, we will focus our lesson on returning selected columns from a database table.

Here is the general syntax for a SELECT statement:

SELECT column1, column2, column3, ...
FROM table

In its simplest form this idea is you can use the SELECT statement to return one or more columns from a database table.

Below is an excerpt from the person table from the AdventureWorks database. The rows represent people, and columns, items that describe them, such as their names.

SQL SELECT Sample Data

SELECT ONE or More Columns

We now try selecting people from the table under the person field using the SQL SELECT statement. Use the box below and click on Run Query to try it.

SELECT FirstName, LastName FROM Person.Person
SELECT FirstName, LastName
FROM   Person.Person

Do you notice something on the SELECT statement? There are two parts to the SELECT statement:

  • First part: Columns separated by commas.
  • Second part: A FROM clause. This is where we specify which table to query.

Now that we know this, using the sample below, let us extend our query to include the MiddleName.

Can you complete this query?

SELECT FirstName, LastName FROM Person.Person;
SELECT  FirstName, LastName
FROM   Person.Person;


Use the * to let the SQL Server know what you want to include in every column in your result rather than listing each column in your select statement.

In particular, we return all columns from a single “Person” field.

SELECT * FROM Person.Person;
/* Answer */

This might seem like a very nice short cut; however, I don’t recommend using *. The best practice is to list the column in your SQL SELECT statement.

Additional Resouces

You can learn more about the SELECT command in this article – Simple Select Queries. I would suggest that you read first and familiarize yourself with the SELECT command before we delve into this topic here.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}


Nothing is worse than, being excited to learn a new tool but not knowing where to start, wasting time learning the wrong features, and being overwhelmed .

But it doesn't have to be this way.

I'm Putting together a free email course to help you get started learning SQL Server.