Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
MySQL Tutorial
Select Query 92 codes
Home
MySQL Tutorial
Select Query
1 =NULL
2 Aliasing Function output
3 Aliasing the function in select statement
4 AND and OR may be intermixed, although AND has higher precedence than OR
5 AND operator can also be expressed as &&
6 As
7 BETWEEN Operator
8 Calculation in where clause
9 Column filter and Order by clause
10 Conditions can be combined to achieve better filtering of results
11 Count the number of employees per city only for employees whose description is known
12 Create dynamic sql command
13 DESC keyword applies only to the column name immediately preceding it
14 EXISTS and NOT EXISTS
15 Filter with HAVING clause
16 Get the Row Holding the Maximum of a Certain Column by sorting all rows descending by price and get only the first row using
17 Giving the result of column calculation an alias name
18 Greater and Equal
19 GROUP BY directive can display the data grouped by field
20 Group by NULL value
21 Hierarchy of Conditions
22 In MySQL you can refer to a column using any of the following forms
23 IS NOT NULL
24 IS NULL
25 Is NULL or = NULL
26 Join a many-to-many map table
27 LIKE operator
28 Limit query to start at rows 3-7
29 Logic Operators
30 NOT Between AND
31 NOT can be used with another operator to combine positive and negative conditions
32 NOT Exist with subquery
33 NOT IN is an alias for ALL
34 NOT operator (!) turns a positive into a negative
35 NULL with EXISTS condition
36 On character type columns, sorting is normally performed in a case-insensitive fashion
37 OR operator can be expressed as
38 ORDER BY controls the sequence of results
39 Order by with limit clause
40 Order first 4 rows
41 Practical Uses of As
42 Random order
43 Restricting Columns
44 Retrieve each unique output record just once by adding the keyword DISTINCT
45 Row constructors can compare subqueries that return two or more columns
46 Row Subqueries
47 Select an alphanumeric range
48 Selecting Particular Columns
49 Sort by date
50 Sort the results in reverse by appending DESC to the condition
51 The basic SELECT statement syntax
52 The DISTINCT qualifier is used to return unique results
53 The expressions (1,2) and ROW(1,2) are sometimes called row constructors
54 The HAVING condition is just another WHERE condition that acts as a secondary constraint on the result set
55 The MATCH function also sorts multiple results be relevance with the first result being the most relevant
56 The SELECT statement is used to pull information from a table
57 Three-Table Join
58 To match the letter a in any first_name we would put a wildcard character before and afterwards in the SQL statement
59 To restrict the output by including WHERE conditions
60 To retrieve the rest of the records in batches we can also specify a starting point before the number or rows to return
61 To sort a result, use an ORDER BY clause
62 To sort in reverse (descending) order, add the DESC keyword to the name of the column
63 To sort the output by alias
64 To use a case-sensitive sort for a column by using BINARY
65 UNION allows you to combine the results from different tables
66 UNION Joins
67 Use a WHERE clause to combine row selection with column selection
68 Use Aliasing in table joins
69 Use As in table joins
70 Use AS to give a more meaningful name
71 Use count(), OR and Group by
72 Use String function in select statement
73 Use the LIMIT condition to restrict the number or records returned
74 Use the OR operator
75 Use user-defined variable in the where statement
76 User variables are written as @var_name
77 Using both DESC and ASC in order clause
78 Using EXISTS with subquery
79 Using Full Text Searches
80 Using Group and Having clause with table join
81 Using IN operator
82 Using IN with subquery
83 Using NOT EXISTS with sub query
84 Using NOT IN with subquery
85 Using the full TABLE COLUMN reference
86 Using User-Defined Variables
87 We can use two or more ORDER BY conditions
88 With no GROUP columns is illegal if there is no GROUP BY clause
89 You can also assign a value to a user variable in statements other than SET
90 You can combine conditions
91 You can retrieve rows in random order
92 You can use COUNT() if you want to find out how many employees each city has