Solved

Oracle Roll Up Syntax Error

Posted on 2013-12-26
1
410 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

733 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