is it necessary to write group by and order by clause together
Answers were Sorted based on User's Feedback
Answer / suman
No Required.
Group by is grouping the records
but Order by mention the data should be desc or asc order.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / madhav
yes,
select deptno,sum(sal) from emp group by deptno;
(it displays ascending order)
when we want to display the descending order,we need order
by clause and group clause.
select deptno,sum(sal) from emp group by deptno order by
deptno desc
(it displays the descending order)
| Is This Answer Correct ? | 9 Yes | 10 No |
what is 'mysqld'? : Sql dba
define a variable representing the expression used to calculate on emps total annual remuneration.use the variable in a statement which finds all emps who can earn 30000 a year or more.
what is the difference between char and varchar data types? : Sql dba
consider a table which contain 4 columns,ename,eno,sal and deptno, from this table i want to know ename who having maximum salary in deptno 10 and 20.
How to display the records between two range in Oracle SQL Plus?
What is data abstraction in sql?
Can a varchar be a primary key?
What is the usage of nvl function?
what are tables and fields? : Sql dba
What is the difference between UNIQUE KEY and UNIQUE INDEX?
Write a sql select query that only returns each name only once from a table?
Is it possible to use LONG columns in WHERE clause or ORDER BY?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)