Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

query not running

Posted on 2014-04-04
5
Medium Priority
?
387 Views
Last Modified: 2014-04-06
Why this query is not working....?

SQL> SELECT * FROM
(
select
    SEGMENT_NAME,
    SEGMENT_TYPE,
    BYTES/1024/1024/1024 GB,
    TABLESPACE_NAME
from
    dba_segments
order by 3 desc
) WHERE
ROWNUM <= 10
/
 14
SQL>
0
Comment
Question by:tonydba
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 39978866
what's not working about it?


it runs fine for me
0
 

Author Comment

by:tonydba
ID: 39978938
The output looks like this..

 SELECT * FROM
(
select
    SEGMENT_NAME,
    SEGMENT_TYPE,
    BYTES/1024/1024/1024 GB,
    TABLESPACE_NAME
from
    dba_segments
order by 3 desc
) WHERE
ROWNUM <= 10
  2    3    4    5    6    7    8    9   10   11   12   13
SQL>
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 39978954
put a semicolon at the end of it



SELECT *
  FROM (  SELECT segment_name,
                 segment_type,
                 bytes / 1024 / 1024 / 1024 gb,
                 tablespace_name
            FROM dba_segments
        ORDER BY 3 DESC)
 WHERE ROWNUM <= 10;
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 39979029
If you copy and paste few sql statements with multiple lines, SQL Plus may display line number inappropriately. If you just type "L" in Sqlplus, you will see all statement with their corrosponding line number.
0
 

Author Closing Comment

by:tonydba
ID: 39981521
Thank you for your effort.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question