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

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

What Are Group Functions
What Are Group Functions? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY Group functions are functions applied to a group of rows. Examples of group functions are: COUNT(*) - Returns the number of rows in the group. MIN(exp) - Returns the minimum value of the expression evaluated on each r...
2007-05-11, 4726👍, 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, 5148👍, 0💬

How To Return Top 5 Rows
How To Return Top 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you want the query to return only the first 5 rows, you can use the LIMIT clause, which takes one parameter as the maximum number of rows to return. The following statement returns the first 5 rows from the fy...
2007-05-11, 7215👍, 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, 4745👍, 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, 4766👍, 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, 4728👍, 0💬

How To Convert Numeric Values to Character Strings
How To Convert Numeric Values to Character Strings? - MySQL FAQs - Introduction to SQL Basics You can convert numeric values to character strings by using the CAST(value AS CHAR) function as shown in the following examples: SELECT CAST(4123.45700 AS CHAR) FROM DUAL; 4123.45700 -- How to get rid of t...
2007-05-11, 5280👍, 0💬

What Happens If You No CREATE Privilege in a Database
What Happens If You No CREATE Privilege in a Database? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements In order to create tables in a database, your user account must have the CREATE privilege for that database. Otherwise you will get an error as shown in the following tutorial ex...
2007-05-11, 4720👍, 0💬

How To Get a List of Indexes of an Existing Table
How To Get a List of Indexes of an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to see the index you have just created for an existing table, you can use the "SHOW INDEX FROM tableName" command to get a list of all indexes in a given table. The tutor...
2007-05-11, 4717👍, 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, 5049👍, 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, 4757👍, 0💬

How To Create a New Table by Selecting Rows from Another Table
How To Create a New Table by Selecting Rows from Another Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements Let's say you have a table with many data rows, now you want to create a backup copy of this table of all rows or a subset of them, you can use the "CREATE TABLE ... SEL...
2007-05-11, 4716👍, 0💬

How To Escape Special Characters in SQL statements
How To Escape Special Characters in SQL statements? - MySQL FAQs - Introduction to SQL Basics There are a number of special characters that needs to be escaped (protected), if you want to include them in a character string. Here are some basic character escaping rules: The escape character (\) needs...
2007-05-11, 7220👍, 0💬

How To Include Numeric Values in SQL statements
How To Include Numeric Values in SQL statements? - MySQL FAQs - Introduction to SQL Basics If you want to include a numeric value in your SQL statement, you can enter it directly as shown in the following examples: SELECT 255 FROM DUAL; -- An integer 255 SELECT -6.34 FROM DUAL; -- A regular number -...
2007-05-11, 5536👍, 0💬

How To Get a List of Columns in an Existing Table
How To Get a List of Columns in an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing table, but you don't remember what are the columns used in the table, you can use the "SHOW COLUMNS FROM tableName" command to get a list of all columns of th...
2007-05-11, 4673👍, 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, 4932👍, 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, 4941👍, 0💬

How To Enter Binary Numbers in SQL Statements
How To Enter Binary Numbers in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want to enter character strings or numeric values as binary numbers, you can quote binary numbers with single quotes and a prefix of (B), or just prefix binary numbers with (0b). Binary numbers will be au...
2007-05-11, 9914👍, 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, 4874👍, 0💬

How To Delete an Existing Column in a Table
How To Delete an Existing Column in a Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you have an existing column in a table and you do not need that column any more, you can delete it with "ALTER TABLE ... DROP COLUMN" statement. Here is a tutorial script to delete an e...
2007-05-11, 4644👍, 0💬

How To Concatenate Two Character Strings
How To Concatenate Two Character Strings? - MySQL FAQs - Introduction to SQL Basics If you want concatenate multiple character strings into one, you need to use the CONCAT() function. Here are some good examples: SELECT CONCAT('Welcome',' to') FROM DUAL; Welcome to SELECT CONCAT('FYI','center','.com...
2007-05-11, 11063👍, 0💬

How To Enter Characters as HEX Numbers
How To Enter Characters as HEX Numbers? - MySQL FAQs - Introduction to SQL Basics If you want to enter characters as HEX numbers, you can quote HEX numbers with single quotes and a prefix of (X), or just prefix HEX numbers with (0x). A HEX number string will be automatically converted into a charact...
2007-05-11, 6789👍, 0💬

How To Rename an Existing Table
How To Rename an Existing Table? - MySQL FAQs - Understanding SQL CREATE, ALTER and DROP Statements If you want to rename an existing table, you can use the "ALTER TABLE ... RENAME TO" statement. The tutorial script below shows you a good example: mysql> ALTER TABLE tip RENAME TO faq; Query OK, 0 ro...
2007-05-11, 4555👍, 0💬

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