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

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, 5128👍, 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, 5121👍, 0💬

Can the Query Output Be Sorted by Multiple Columns
Can the Query Output Be Sorted by Multiple Columns? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value: mysql> SELECT ...
2007-05-11, 5106👍, 0💬

Can Group Functions Be Used in the ORDER BY Clause
Can Group Functions Be Used in the ORDER BY Clause? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If the query output is aggregated as groups, you can sort the groups by using group functions in the ORDER BY clause. The following statement returns how many links were created in each year ...
2007-05-11, 5101👍, 0💬

What Are the Differences between BINARY and VARBINARY
What Are the Differences between BINARY and VARBINARY? - MySQL FAQs - Introduction to SQL Basics Both BINARY and VARBINARY are both binary byte data types. But they have the following major differences: BINARY stores values in fixed lengths. Values are padded with 0x00. VARBINARY stores values in va...
2007-05-11, 5100👍, 0💬

Is the Order of Columns in the SET Clause Important
Is the Order of Columns in the SET Clause Important? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements Yes. The order of columns in the SET clause of the UPDATE statement is important. There is a BIG DIFFERENCE between MySQL and Oracle on update columns with previous values: Orac...
2007-05-11, 5090👍, 0💬

How To Create a Testing Table with Test Data
How To Create a Testing Table with Test Data? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to follow the tutorial exercises presented in this collection, you need to create a testing table and insert some test data, as shown in the following sample script: mysql> CREATE TABLE...
2007-05-11, 5055👍, 0💬

How To Add More Data to the Testing Table
How To Add More Data to the Testing Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to continue with other tutorial exercises in this FAQ collection, you need to add more data to the testing table. Follow the script below to add a new column and : mysql> ALTER TABLE fyi_l...
2007-05-11, 5052👍, 0💬

How To Drop an Existing Index
How To Drop an Existing Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you don't need an existing index any more, you should delete it with the "DROP INDEX indexName ON tableName" statement. Here is an example SQL script: mysql> DROP INDEX tip_subject ON tip; Query OK, ...
2007-05-11, 5051👍, 0💬

How To Select Some Columns from a Table
How To Select Some Columns from a Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want explicitly tell the query to return some columns, you can specify the column names in the SELECT clause. The following select statement returns only two columns, "id" and "url" from the tabl...
2007-05-11, 5039👍, 0💬

How To Use Group Functions in the SELECT Clause
How To Use Group Functions in the SELECT Clause? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If group functions are used in the SELECT clause, they will be used on the rows that meet the query selection criteria, the output of group functions will be returned as output of the query. The...
2007-05-11, 5038👍, 0💬

How To Update Values on Multiple Rows
How To Update Values on Multiple Rows? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If the WHERE clause in an UPDATE matches multiple rows, the SET clause will be applied to all matched rows. This rule allows you to update values on multiple rows in a single UPDATE statement...
2007-05-11, 5038👍, 0💬

How To Use Values from Other Tables in UPDATE Statements
How To Use Values from Other Tables in UPDATE Statements? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to update values in one table with values from another table, you can use a subquery as an expression in the SET clause. The subquery should return only one row...
2007-05-11, 5031👍, 0💬

How To Update Values in a Table
How To Update Values in a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to update some values in one row or multiple rows in a table, you can use the UPDATE statement. The tutorial script below shows a good example: mysql> UPDATE fyi_links SET counts = 999,...
2007-05-11, 5017👍, 0💬

How To Specify Default Values in INSERT Statement
How To Specify Default Values in INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial ...
2007-05-11, 5002👍, 0💬

How To Insert a New Row into a Table
How To Insert a New Row into a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements To insert a new row into a table, you should use the INSERT INTO statement with values specified for all columns as shown in the following example: mysql> INSERT INTO fyi_links VALUES (101, 'd...
2007-05-11, 5002👍, 0💬

How To See the CREATE TABLE Statement of an Existing Table
How To See the CREATE TABLE Statement of an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to know how an existing table was created, you can use the "SHOW CREATE TABLE" command to get a copy of the "CREATE TABLE" statement back on an existing table. T...
2007-05-11, 4994👍, 0💬

How To Create a Table Index
How To Create a Table Index? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have a table with a lots of rows, and you know that one of the columns will be used often as a search criteria, you can add an index for that column to improve the search performance. To add an ind...
2007-05-11, 4992👍, 0💬

How To Convert Character Strings to Numeric Values
How To Convert Character Strings to Numeric Values? - MySQL FAQs - Introduction to SQL Basics You can convert character strings to numeric values by using the CAST(string AS DECIMAL) or CAST(string AS SIGNED INTEGER) function as shown in the following examples: SELECT CAST('4123.45700' AS DECIMAL) F...
2007-05-11, 4989👍, 0💬

How To Drop an Existing View
How To Drop an Existing View? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing view, and you don't want it anymore, you can delete it by using the "DROP VIEW viewName" statement as shown in the following script: mysql> DROP VIEW faqComment; Query OK, 0 rows ...
2007-05-11, 4988👍, 0💬

How To Delete Multiple Rows from a Table
How To Delete Multiple Rows from a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements You can delete multiple rows from a table in the same way as deleting a single row, except that the WHERE clause will match multiple rows. The tutorial exercise below deletes 3 rows from t...
2007-05-11, 4985👍, 0💬

What Are Date and Time Data Types
What Are Date and Time Data Types? - MySQL FAQs - Introduction to SQL Basics MySQL supports the following date and time data types: DATE - A date in the range of '1000-01-01' and '9999-12-31'. Default DATE format is "YYYY-MM-DD". DATETIME - A date with the time of day in the range of '1000-01-01 00:...
2007-05-11, 4977👍, 0💬

How To Use CASE Expression
How To Use CASE Expression? - MySQL FAQs - Introduction to SQL Basics There are 2 ways to use the CASE expression. The first way is to return one of the predefined values based on the comparison of a given value to a list of target values. The second way is to return one of the predefined values bas...
2007-05-11, 4974👍, 0💬

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

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