SQL explained: What is SQL | Select Statement | Select Where | Insert | Update/Edit | Delete | Order By | Select Between

SQL Select Statement

The SQL Select statement is the most commonly used and basic SQL statement.

Syntax: SELECT * FROM Tablename

The * character acts as a wildcard and will select all the columns in the Table without you having to write all the column names out individually.

If we wanted to select all the records from our table 'Members_tbl' in diagram 1 below we could use either of the following Select Statements.

SELECT * FROM Members_tbl
SELECT FirstName, LastName, Address, City FROM Members_tbl

Diagram 1
SELECT Statement

If we just wanted to select all the records from our table though not all the columns we could use the syntax below;

Syntax: SELECT (column names) FROM Tablename

Here's an example suppose we run the SQL below

SELECT FirstName, LastName, Address FROM Members_tbl

This will select the FirstName, LastName and Address from the Members_tbl Table. We are not retrieving the City column as shown in our Members_tbl in Diagram 2.

Diagram 2
SQL Select Statement

To learn how to use the Select Where statement click here.

Get the best asp hosting provider from web-hosting-top.com and save up to 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Global ASP.NET Hosting Leader - Click Here