Category: Clauses/Conditions
-
Union All Operator
The SQLite UNION ALL operator is used to combine the result of two or more SELECT statement without ignoring the duplicate rows. In SQLite UNION ALL, the resultant table also includes the duplicate values. Otherwise, the same rule applies as Union. Syntax: Example: We have two tables “STUDENT” and “DEPARTMENT”. The “STUDENT” table is having…
-
Union Operator
SQLite UNION Operator is used to combine the result set of two or more tables using SELECT statement. The UNION operator shows only the unique rows and removes duplicate rows. While using UNION operator, each SELECT statement must have the same number of fields in the result set. Syntax: Example: We have two tables “STUDENT”…
-
DISTINCT Clause
The SQLite DISTINCT clause is used with SELECT statement to eliminate all the duplicate records and fetching only unique records. It is used when you have multiple duplicate records in the table. Syntax: Example: We have a table named “STUDENT”, having the following data: First Select NAME from “STUDENT” without using DISTINCT keyword. It will…
-
HAVING Clause
The SQLite HAVING clause is used to specify conditions that filter which group results appear in the final results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause. The position of HAVING clause in a SELECT query: Syntax: Example: Let’s take…
-
GROUP BY Clause
The SQLite GROUP BY clause is used with SELECT statement to collaborate the same identical elements into groups. The GROUP BY clause is used with WHERE clause in SELECT statement and precedes the ORDER BY clause. Syntax: Let’s take an example to demonstrate the GROUP BY clause. We have a table named “STUDENT”, having the…
-
ORDER BY Clause
The SQLite ORDER BY clause is used to sort the fetched data in ascending or descending order, based on one or more column. Syntax: You can use one or more columns in ORDER BY clause. Your used column must be presented in column-list. Let’s take an example to demonstrate ORDER BY clause. We have a…
-
LIMIT Clause
The SQLite LIMIT clause is used to limit the data amount fetched by SELECT command from a table. Syntax: The LIMIT clause can also be used along with OFFSET clause. Example: Let’s take an example to demonstrate SQLite LIMIT clause. We have a table named ‘STUDENT’ having following data: Example1: Fetch the records from the…
-
GLOB Clause (Operator)
The SQLite GLOB operator matches only text values against a pattern by using wildcards. When the search expression is matched with the pattern expression, the GLOB operator will return true which is 1. The GLOB operator follows syntax of UNIX for specifying THE following wildcards. Syntax: Syntax for asterisk sign: Syntax for question mark: Example:…
-
LIKE Clause (Operator)
The SQLite LIKE operator is used to match text values against a pattern using wildcards. In the case search expression is matched to the pattern expression, the LIKE operator will return true, which is 1. There are two wildcards used in conjunction with the LIKE operator: The percent sign represents zero, one, or multiple numbers…
-
OR Operator
The SQLite OR Operator is generally used with SELECT, UPDATE and DELETE statement to combine multiple conditions. OR operator is always used with WHERE clause and the complete condition is assumed true if anyone of the both condition is true. Syntax: You can combine multiple number of conditions using OR operator. Example: We have a…