Sql Select

The very basic of Sql Select has the following syntax.

SELECT column_list
FROM   Table_name(s) 

The above sql select statement is the Sql statement in its simplest form, it tells which columns to select and from what table you want to get data. Later, you can add more advanced options to the statement that can make it very powerful.


If you need to select all columns from a table, you can use "*" to replace column_list.

To illustrate, let's use the following CONTACTS table that lists your contacts persons:

1WhiteAlan210 George StSydneyNSW2000
2 Johnson Benjamin 11 Cooper St Surry Hill NSW 2010
3 Brown Peter 72 Haymarket St Haymarket NSW 2000
4 Anderson Thomas 33 Collins St Melbourne VIC 3000
5 Gomdas Tony 78 Marine Pde Coolangatta QLD 4225

If you just want to know the names in your contact, to do this write this sql select:

SELECT Surname, Firstname
FROM Contacts

If you want to list all columns in that Contacts table, you type this sql:

FROM Contacts

That displays everything in that table.

Wait the minute, you said, I only want to see contacts that live in NSW. What do I do?
To do that you need WHERE clause in the Select statement, which will be discussed next in the Sql Where section.

Quick link. From here, you can learn the following:

Sql Distinct
Eliminating duplicate values in the output.

Sql Where
Conditionally selecting rows from table.

Sql Like
Pattern searching for conditions in Where or Having clause

Sql Between
Added to conditions to show results between two values.

Sql In
It enables us to specify multiple values, either as a list or a subquery.

Sql And Or
Connecting two or more conditions in the Where or Having clause.

Sql Count
Counting number of rows.

Sql Sum
Getting the sum of a field

Sql Max
This function will return the highest value.

Sql Min
This function will return the lowest value.

Sql Avg
This function will return the average value.

Sql Order By
Sorting the output

Sql Group By
Grouping rows into sets.

Sql Having
To filter the result of aggregation

Buy at AllPosters.com
A bend in the road is not the end of the road... unless you fail to make the turn

Positive Resources

All of us have at least two or three things that excite us. We could talk about these subjects for hours. Good news!. Did you know that Site Built It! can turn this type of deep interest and enthusiasm into a revenue-generating business?

Review some of the Site Build It! case studies and you'll absolutely discover something that ignites more positive ideas into your mind.

SBI! Video Tour

Invest the most
important 30 minutes
you will spend online.

Click, sit back, and
understand why SBI!
makes you succeed.