<< < 17 18 19 20 21 22 23 24 > >>   Sort: Rank

How To Sort Output in Descending Order
How To Sort Output in Descending Order? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements If you want to sort a column in descending order, you can specify the DESC keyword in the ORDER BY clause. The following SELECT statement first sorts the department in descending order, then sorts th...
2007-04-20, 5661👍, 0💬

How To Filter Out Duplications in the Returning Rows
How To Filter Out Duplications in the Returning Rows? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements If there are duplications in the returning rows, and you want to remove the duplications, you can use the keyword DISTINCT or UNIQUE in the SELECT clause. The tutorial exercise below sh...
2007-04-20, 5055👍, 0💬

Can SELECT Statements Be Used on Views
Can SELECT Statements Be Used on Views? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements Select (query) statements can used on views in the same way as tables. The following tutorial exercise helps you creating a view and running a query statement on the view: SQL> CREATE VIEW managed_de...
2007-04-20, 5380👍, 0💬

How To Use Group Functions in the SELECT Clause
How To Use Group Functions in the SELECT Clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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....
2007-04-20, 5061👍, 0💬

What Are Group Functions
What Are Group Functions? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 ea...
2007-04-20, 4741👍, 0💬

Can Group Functions Be Mixed with Non-group Selection Fields
Can Group Functions Be Mixed with Non-group Selection Fields? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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...
2007-04-20, 5164👍, 0💬

How To Divide Query Output into Groups
How To Divide Query Output into Groups? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements You can divide query output into multiple groups with the GROUP BY clause. It allows you specify a column as the grouping criteria, so that rows with the same value in the column will be considered a...
2007-04-20, 5649👍, 0💬

How To Count Duplicated Values in a Column
How To Count Duplicated Values in a Column? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 ... HAV...
2007-04-20, 4942👍, 0💬

How To Apply Filtering Criteria at Group Level
How To Apply Filtering Criteria at Group Level? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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. The following script give...
2007-04-20, 4851👍, 0💬

Can Group Functions Be Used in the ORDER BY Clause
Can Group Functions Be Used in the ORDER BY Clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 employees are having the sam...
2007-04-20, 4817👍, 0💬

Can Multiple Columns Be Used in GROUP BY
Can Multiple Columns Be Used in GROUP BY? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements You can use multiple columns in the GROUP BY clause as shown in the following example. It returns how many employees are having the same salary in each department: SQL> SELECT department_id, salary...
2007-04-20, 5110👍, 0💬

How To Join Two Tables in a Single Query
How To Join Two Tables in a Single Query? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements Two tables can be joined together in a query in 4 ways: Inner Join: Returns only rows from both tables that satisfy the join condition. Left Outer Join: Returns rows from both tables that satisfy t...
2007-04-20, 5267👍, 0💬

How To Write a Query with an Inner Join
How To Write a Query with an Inner Join? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 following query returns output with an inner join from two tables: employees...
2007-04-19, 5026👍, 0💬

How To Define and Use Table Alias Names
How To Define and Use Table Alias Names? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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: SQL> SELECT e.first_name, e.la...
2007-04-19, 5654👍, 0💬

How To Write a Query with a Left Outer Join
How To Write a Query with a Left Outer Join? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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-04-19, 5263👍, 0💬

How To Write a Query with a Right Outer Join
How To Write a Query with a Right Outer Join? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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-04-19, 7643👍, 0💬

How To Write a Query with a Full Outer Join
How To Write a Query with a Full Outer Join? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements If you want to query from two tables with a full outer join, you can use the FULL OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a full outer join from two ...
2007-04-19, 5108👍, 0💬

How To Write an Inner Join with the WHERE Clause
How To Write an Inner Join with the WHERE Clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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: SQL> SELECT d.depar...
2007-04-19, 5222👍, 0💬

How To Write a Left Outer Join with the WHERE Clause
How To Write a Left Outer Join with the WHERE Clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements If you don't want to use the LEFT OUTER JOIN ... ON clause to write a left outer join, you can use a special criteria in the WHERE clause as "left_table.column = right_table.column(+)"....
2007-04-19, 5337👍, 0💬

How To Name Query Output Columns
How To Name Query Output Columns? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 y...
2007-04-19, 5418👍, 0💬

What Is a Subquery
What Is a Subquery? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 ou...
2007-04-19, 5028👍, 0💬

How To Use Subqueries with the IN Operator
How To Use Subqueries with the IN Operator? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements A subquery can be used with the IN operator as "expression IN (subquery)". The subquery should return a single column with one or more rows to form a list of values to be used by the IN operation...
2007-04-19, 4896👍, 0💬

How To Use Subqueries with the EXISTS Operator
How To Use Subqueries with the EXISTS Operator? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 (subq...
2007-04-19, 5022👍, 0💬

How To Count Groups Returned with the GROUP BY Clause
How To Count Groups Returned with the GROUP BY Clause? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements 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 num...
2007-04-19, 5383👍, 0💬

<< < 17 18 19 20 21 22 23 24 > >>   Sort: Rank