|
|
|
|
|
|
|
|
|
|
Re: SQL*Plus FAQ for client tools forum [message #619699 is a reply to message #619696] |
Thu, 24 July 2014 10:52   |
 |
Michel Cadot
Messages: 68757 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
My purpose was to emphasize to serious need of this. For instance, to order the result on something you don't want to get:
SQL> col dt noprint
SQL> select hiredate dt, to_char(hiredate,'DD/MM/YYYY') hiredate, ename from emp order by dt;
HIREDATE ENAME
---------- ----------
17/12/1980 SMITH
20/02/1981 ALLEN
22/02/1981 WARD
02/04/1981 JONES
01/05/1981 BLAKE
09/06/1981 CLARK
08/09/1981 TURNER
28/09/1981 MARTIN
17/11/1981 KING
03/12/1981 JAMES
03/12/1981 FORD
23/01/1982 MILLER
19/04/1987 SCOTT
23/05/1987 ADAMS
An order on the first displayed column (second in the query) will not give the result in the expected order.
Another example is when you want to display a set of queries in UNION ALL in a specific order then you can add a pseudo-column which numbers the query in the order you want in the final result and order this UNION ALL on this column (and possibly other ones).
[Updated on: Thu, 31 July 2014 14:36] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: SQL*Plus FAQ for client tools forum [message #636211 is a reply to message #621317] |
Mon, 20 April 2015 01:57  |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
7. How to get rid off the underline below column headers
In below test case, I don't want to print the underline for the column headers.
SQL> SELECT empno, ename FROM emp WHERE ROWNUM <= 5;
EMPNO ENAME
---------- ----------
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
SQL> SET UNDERLINE OFF
SQL> SELECT empno, ename FROM emp WHERE ROWNUM <= 5;
EMPNO ENAME
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
SQL>
|
|
|