You add Where clause to the Sql Select to filter the result.
Sql Where syntax:
Let's use the previous CONTACTS table for illustration. You want to get a list of people that live in NSW. (By the way, NSW is a State name in Australia where I used to live).
To do this write this sql:
This is the result:
Assume, for the sake of argument, that you know the Id of a person is 4 but you can't remember the name. How do you retrieve the data?
Write the following Sql Where:
And the result is:
Recaps. What you need to know about sql where are:
The equality operators that are allowed for the conditions are: = , > , < , >= , <= or <> (unequal).
What if you use the > (greater than) or <(less than) operator in the condition where the field type is a text. How the system compare them?
The answer is using ASCII table. The ASCII table is the numerical representation of characters. (See this link for you reference)
There are three other possible operators that can be used in the Where condition:
In the next section, we are going to discuss the Sql Distinct to get unique values of a certain column.
The core of Sql, selecting data from table.
Eliminating duplicate values in the output.
Pattern searching for conditions in Where or Having clause
Added to conditions to show results between two values.
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.
Counting number of rows.
Getting the sum of a field
This function will return the highest value.
This function will return the lowest value.
This function will return the average value.
Sql Order By
Sorting the output
Sql Group By
Grouping rows into sets.
To filter the result of aggregation
Return from Sql Where to Sql Commands
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
Buy at AllPosters.com
Sydney Harbor Bridge, Sydney, Australia