Solved

Oracle Roll Up Syntax Error

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now