?
Solved

Oracle Roll Up Syntax Error

Posted on 2013-12-26
1
Medium Priority
?
420 Views
Last Modified: 2014-01-21
I am trying to perform a Roll Up in Toad for Oracle to produce results like this:

BEACH_NAMES    BEACH_NAMES_CNT
- ----------
0        103
1         87
2         71
3         52
4         88
5        113
6        163
7        412
8        537
9        592
        2218

Using this Query:

SELECT SUBSTR(BEACH_NAMES,1,1) BEACH_NAMES, COUNT(*) BEACH_NAMES_CNT FROM  BEACH_SEC_INFO GROUP BY ROLLUP SUBSTR(BEACH_NAMES,1,1));

I am getting a syntax error, I spend most of my time in SQL Server.  I have access to multiple instances and perhaps I need to include DBO?
0
Comment
Question by:JGH5
1 Comment
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 2000 total points
ID: 39740551
For one, there is nothing more to ROLLUP to!
All lines already are summarized and totaled in last line "2,218".
:p

Why do you keep all the information about the error secret?

PS: You can also try adding a missing parenthesis:
  . . . GROUP BY ROLLUP ( SUBSTR(BEACH_NAMES,1,1) );
-- - - - - - - Here - - ^

Open in new window

0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

850 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