< 1 2 3 4 5 > >>   Sort: Date

How To Write a Query with an Inner Join
How To Write a Query with an Inner Join? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want to query from two tables with an inner join, you can use the INNER JOIN ... ON clause in the FROM clause. The tutorial exercise below creates another testing table and returns output wi...
2007-05-11, 5064👍, 0💬

How To Sort the Query Output
How To Sort the Query Output? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want the returning rows to be sorted, you can specify a sorting expression in the ORDER BY clause. The simplest sort expression is column name who's values will be sorted by. The following select statement ...
2007-05-11, 5024👍, 0💬

How To Use UNION to Merge Outputs from Two Queries Together
How To Use UNION to Merge Outputs from Two Queries Together? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you have two queries that returns the same row fields, you can merge their outputs together with the UNION operator. The following tutorial exercise shows you how to return a...
2007-05-11, 5003👍, 0💬

Can Multiple Columns Be Used in GROUP BY
Can Multiple Columns Be Used in GROUP BY? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to break your output into smaller groups, if you specify multiple column names or expressions in the GROUP BY clause. Output in each group must satisfy a specific combination of the express...
2007-05-11, 4985👍, 0💬

How To Write an Inner Join with the WHERE Clause
How To Write an Inner Join with the WHERE Clause? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you don't want to use the INNER JOIN ... ON clause to write an inner join, you can put the join condition in the WHERE clause as shown in the following query example: mysql> SELECT l.id...
2007-05-11, 4972👍, 0💬

What Happens If the UPDATE Subquery Returns No Rows
What Happens If the UPDATE Subquery Returns No Rows? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you use a subquery to assign new values in the SET clause in an UPDATE statement, and the subquery returns no rows for an outer row, MySQL will provide a NULL value to the SE...
2007-05-11, 4909👍, 0💬

How To Include Character Strings in SQL statements
How To Include Character Strings in SQL statements? - MySQL FAQs - Introduction to SQL Basics If you want to include character strings in your SQL statements, you need to quote them in one of the following formats: Using single quotes. For example 'FYIcenter.com'. Using double quotes. For example "F...
2007-05-11, 4900👍, 0💬

What Happens If Unique Value Constraints Are Violated
What Happens If Unique Value Constraints Are Violated? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you are inserting a new record that has values violating a unique constraint, you will get an error. Note that primary key column has a unique value constraint by default. ...
2007-05-11, 4898👍, 0💬

How To Use SELECT Statement to Count the Number of Rows
How To Use SELECT Statement to Count the Number of Rows? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to count the number of rows, you can use the COUNT(*) function in the SELECT clause. The following tutorial exercise shows you some good example: mysql> SELECT COUNT(*) FROM ...
2007-05-11, 4891👍, 0💬

How To Count Duplicated Values in a Column
How To Count Duplicated Values in a Column? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you have a column with duplicated values, and you want to know what are those duplicated values are and how many duplicates are there for each of those values, you can use the GROUP BY ... HAVING ...
2007-05-11, 4867👍, 0💬

What Happens If the UPDATE Subquery Returns Multiple Rows
What Happens If the UPDATE Subquery Returns Multiple Rows? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If a subquery is used in a UPDATE statement, it must return exactly one row for each row in the update table that matches the WHERE clause. If it returns multiple rows, My...
2007-05-11, 4856👍, 0💬

What Is a Subquery
What Is a Subquery? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries A subquery is a SELECT statement used as part of the selection criteria of the main SELECT statement. The subquery specified in the WHERE clause will be evaluated repeated on each row of the selection base table. The o...
2007-05-11, 4822👍, 0💬

How To Write a Query with a Full Outer Join
How To Write a Query with a Full Outer Join? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries There is no way to do full outer join in MySQL. It does not support this feature at the current MySQL release.
2007-05-11, 4806👍, 0💬

How To Use Regular Expression in Pattern Match Conditions
How To Use Regular Expression in Pattern Match Conditions? - MySQL FAQs - Introduction to SQL Basics If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern condition: REGEXP. The following tutorial exercise provides you some good examples: SELECT 'FY...
2007-05-11, 4798👍, 0💬

What Are Numeric Data Types
What Are Numeric Data Types? - MySQL FAQs - Introduction to SQL Basics MySQL supports the following numeric data types: BIT(n) - An integer with n bits. BOOL same as BOOLEAN - Boolean values stored in 1 bit. TINYINT - A small integer stored in 1 byte. SMALLINT - A small integer stored in 2 bytes. ME...
2007-05-11, 4788👍, 0💬

What Happens If NULL Values Are Involved in Expressions
What Happens If NULL Values Are Involved in Expressions? - MySQL FAQs - Introduction to SQL Basics If NULL values are used in expressions, the resulting values will be NULL values. In other words: Arithmetic expressions with NULL values result NULL values. Comparison expressions with NULL values res...
2007-05-11, 4780👍, 0💬

How To Write a Query with a Right Outer Join
How To Write a Query with a Right Outer Join? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want to query from two tables with a right outer join, you can use the RIGHT OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a right outer join from...
2007-05-11, 4758👍, 0💬

How To Define and Use Table Alias Names
How To Define and Use Table Alias Names? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries When column names need to be prefixed with table names, you can define table alias name and use them to prefix column names as shown in the following select statement: mysql> SELECT l.id, l.url, r....
2007-05-11, 4758👍, 0💬

How To Use Existing Values in UPDATE Statements
How To Use Existing Values in UPDATE Statements? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If a row matches the WHERE clause in a UPDATE statement, existing values in this row can be used in expressions to provide new values in the SET clause. Existing values are represen...
2007-05-11, 4755👍, 0💬

What Are NULL Values
What Are NULL Values? - MySQL FAQs - Introduction to SQL Basics NULL is a special value that represents no value. Here are basic rules about NULL values: NULL presents no value. NULL is not the same as an empty string ''. NULL is not the same as a zero value 0. NULL can be used as any data type. NUL...
2007-05-11, 4751👍, 0💬

How To Name Query Output Columns
How To Name Query Output Columns? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries Each column in the query output has a default name. If you don't like the default name, you can specify a new name for any column in the query output by using the AS clause. The following statement shows ...
2007-05-11, 4750👍, 0💬

How To Add a New Column to an Existing Table
How To Add a New Column to an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing table with existing data rows, and want to add a new column to that table, you can use the "ALTER TABLE ... ADD COLUMN" statement. The tutorial script below shows ...
2007-05-11, 4741👍, 0💬

What Are the Differences between CHAR and VARCHAR
What Are the Differences between CHAR and VARCHAR? - MySQL FAQs - Introduction to SQL Basics CHAR and VARCHAR are both ASCII character data types by default. But they have the following major differences: CHAR stores values in fixed lengths. Values are padded with space characters to match the speci...
2007-05-11, 4741👍, 0💬

How To Create a New View
How To Create a New View? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements You can create a new view based on one or more existing tables by using the "CREATE VIEW viewName AS selectStatement" statement as shown in the following script: mysql> CREATE TABLE comment (faqID INTEGER, m...
2007-05-11, 4740👍, 0💬

< 1 2 3 4 5 > >>   Sort: Date