The ORDER BY clause can only be used in

Options
- SELECT queries
- INSERT queries
- GROUP BY queries
- HAVING queries


CORRECT ANSWER : SELECT queries

Discussion Board
Plsql

Good

Rakesh kp 06-27-2023 07:58 PM

ORDER BY clause

The Oracle ORDER BY clause is used to sort the records in your result set. The ORDER BY clause can only be used in SELECT statements.

Syntax:

SELECT expressions
FROM tables
[WHERE conditions]
ORDER BY expression [ ASC | DESC ];

where,

expressions: The columns or calculations that you wish to retrieve.
tables: The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause.
WHERE condition is optional. The conditions that must be met for the records to be selected.
ASC condition is optional. It sorts the result set in ascending order by expression (default, if no modifier is provider).
DESC condition is optional. It sorts the result set in descending order by expression.

Prajakta Pandit 02-15-2017 05:45 AM

All of the above!

I just ran an INSERT query that successfully inserted the result set of a SELECT statement containing a GROUP BY, HAVING, and an ORDER BY clause. So, as with many of the questions in this test, I am confused about what this question is really asking or what the answer means.
It appears the correct answer would have been: All of the above

INSERT into temp
SELECT count(*), job_id
FROM hr.employees
GROUP BY job_id
HAVING count(*) > 2
ORDER BY job_id;

Doug 01-13-2017 11:45 AM

oraclesql

good questions

divya 06-14-2016 07:30 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement