1 2 3 4 5 > >>   Sort: Rank

How To Calculate Expressions with SQL Statements
How To Calculate Expressions with SQL Statements? - MySQL FAQs - Introduction to SQL Basics There is no special SQL statements to calculate expressions. But you can use the "SELECT expression FROM DUAL" statement return the calculated value of an expression. "DUAL" is a dummy table in the server. Th...
2016-11-09, 6545👍, 1💬

💬 2016-11-09 lux: good

SQL
How do you update 100 rows with single query with variable data populating each row ?
2014-09-19, 1858👍, 0💬

SQL Joins
What is the difference between Inner Join and Outer Join? 1. You use INNER JOIN to return all rows from both tables where there is a match. ie. in the resulting table all the rows and colums will have values. In OUTER JOIN the relulting table may have empty colums. Outer join may be either LEFT or R...
2008-09-25, 5043👍, 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, 4675👍, 0💬

How To Filter Out Duplications in the Returning Rows
How To Filter Out Duplications in the Returning Rows? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If there are duplications in the returning rows, and you want to remove the duplications, you can use the keyword DISTINCT in the SELECT clause. The DISTINCT applies to the combination of a...
2007-05-11, 4255👍, 0💬

How To Omit Columns with Default Values in INSERT Statement
How To Omit Columns with Default Values in INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you c...
2007-05-11, 4797👍, 0💬

How To Select All Columns of All Rows from a Table
How To Select All Columns of All Rows from a Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY The simplest query statement is the one that selects all columns of all rows from a single table: "SELECT * FROM tableName;". The (*) in the SELECT clause tells the query to return all column...
2007-05-11, 5629👍, 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, 4576👍, 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, 4585👍, 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, 4592👍, 0💬

Can Group Functions Be Mixed with Non-group Selection Fields
Can Group Functions Be Mixed with Non-group Selection Fields? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If a group function is used in the SELECT clause, all other selection fields must be group level fields. Non-group fields can not be mixed with group fields in the SELECT clause. Th...
2007-05-11, 4864👍, 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, 4314👍, 0💬

How To Count Groups Returned with the GROUP BY Clause
How To Count Groups Returned with the GROUP BY Clause? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If you use the COUNT(*) function on groups returned with the GROUP BY clause, it will count the number of rows within each group, not the number of groups. If you want to count the nu...
2007-05-11, 5047👍, 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, 4325👍, 0💬

How To Insert Multiple Rows with One INSERT Statement
How To Insert Multiple Rows with One INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements If you want to insert multiple rows with a single INSERT statement, you can use a subquery instead of the VALUES clause. Rows returned from the subquery will be inserted the t...
2007-05-11, 4290👍, 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, 4551👍, 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, 4357👍, 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, 4586👍, 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, 4404👍, 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, 4365👍, 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, 4357👍, 0💬

How To Apply Filtering Criteria at Group Level
How To Apply Filtering Criteria at Group Level? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY If you want to return only specific groups from the query, you can apply filtering criteria at the group level by using the HAVING clause inside the GROUP BY clause. Note group functions can also...
2007-05-11, 5562👍, 0💬

How To Use Subqueries with the EXISTS Operator
How To Use Subqueries with the EXISTS Operator? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries A subquery can be used with the EXISTS operator as "EXISTS (subquery)", which returns true if the subquery returns one or more rows. The following statement is a good example of "EXISTS (sub...
2007-05-11, 5099👍, 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, 4448👍, 0💬

1 2 3 4 5 > >>   Sort: Rank