Home > Not A > Not A Single Group Function Error

Not A Single Group Function Error

Contents

How to securely erase with Disk Utility on El Capitan & Sierra Asking for a written form filled in ALL CAPS What is the correct plural of "training"? GROUP BY is used in conjunction with aggregate functions to filter the results by a value. Answer: You are missing the GROUP BY clause in your function. CREATE TABLE tickets ( tickets_id number(4) not null PRIMARY KEY, route_id number(4) not null, bus_id number(4) not null, fare number(5,2) not null, CONSTRAINT routeid_fk FOREIGN KEY (route_id) REFERENCES route(route_id), CONSTRAINT busid_fk navigate here

A penny saved is a penny Is this a valid way to prove this modified harmonic series diverges? Just e-mail: and include the URL for the page. Using only one cpu core "Surprising" examples of Markov chains Criminals/hackers trick computer system into backing up all data into single location Query Author Apex Permission? When I take it out it works fine.

Not A Single-group Group Function Count

You could add additional clauses to the order by if you'd like to specify how to order it yourself. Even though the process of correcting this error is not too difficult, contact your database administrator or licensed Oracle consultant if you continue to face problems with ORA-00937. If you want to get all the ones tied for first I believe you'll need nested queries, one to get the max time then another to pull back all the ones

Do I need to do this? Join them; it only takes a minute: Sign up SQL not a single-group group function up vote 24 down vote favorite 2 When I run the following SQL statement: SELECT MAX(SUM(TIME)) Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the Ora-00937 Not A Single-group Group Function Example Databases SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL SQLite MS Office Excel Access Word Web Development HTML CSS Color Picker Languages C Language More ASCII Table Linux UNIX Java

AVG, COUNT, MAX, MIN…), you must have a GROUP BY clause. Not A Single-group Group Function Max Also, ORA-00937 may be occurring because of your SELECT clause. Option #2 Remove the GROUP BY function (ie: MIN Function, MAX Function, SUM Function, COUNT Function) from the SELECT statement. Option #1 will give you the sum of "Stages.Distance_Between" for all Stages within Journeys (which is probably semantically incorrect because a the distance is already recorded at the stage level, there

I keep getting a not a single-group group function error when i try to run this query. Ora-00937 Not A Single-group Group Function Max How to securely erase with Disk Utility on El Capitan & Sierra Is a food chain without plants plausible? asked 6 months ago viewed 257 times active 1 month ago Related 2Use of hash functions in group by?3Pivoting data for stacked charts (grouping and creating new columns for each distinct Take the example of the small business CEO who wants to view a list of employees who worked the most number of hours, organized by department.

Not A Single-group Group Function Max

If you find an error or have a suggestion for improving our content, we would appreciate your feedback. What's the source for the Point Buy alternative ability score rules? Not A Single-group Group Function Count What is the verb for "pointing at something with one's chin"? Not A Single-group Group Function Sum AVG, COUNT, MAX, MIN…), you must have a GROUP BY clause.

SELECT LGBRAND.BRAND_ID, LGBRAND.BRAND_NAME, AVG(LGPRODUCT.PROD_PRICE) AS AVGER FROM LGPRODUCT, LGBRAND WHERE LGPRODUCT.BRAND_ID = LGBRAND.BRAND_ID group by LGBRAND.BRAND_ID, LGBRAND.BRAND_NAME -- This line here ORDER BY BRAND_NAME; share|improve this answer answered Nov 26 '13 check over here SELECT LGBRAND.BRAND_ID, LGBRAND.BRAND_NAME, AVG(LGPRODUCT.PROD_PRICE)AS AVGER FROM LGPRODUCT, LGBRAND WHERE LGPRODUCT.BRAND_ID = LGBRAND.BRAND_ID GROUP BY LGBRAND.BRAND_ID, LGBRAND.BRAND_NAME ORDER BY BRAND_NAME share|improve this answer answered Nov 26 '13 at 2:40 Andrew 4,5411726 add OSN: Which One to ChooseOctober 13, 2016 - 7:44 pmPress Release: TekStream Makes 2016 INC. 5000 List For Second Consecutive YearOctober 11, 2016 - 6:08 pm Oracle Content ManagementContent Management Strategy Oracle PostersOracle Books Oracle Scripts Ion Excel-DB Don Burleson Blog

ORA-00937: not a single-group group function tips Oracle Not A Group By Function

Measuring air density - where is my huge error coming from? Also provide sample data from tickets table. –JSapkota Apr 11 at 10:41 You need to group by every non-aggregate column of your query, : GROUP BY by bus, dest Pros and cons of investing in a cheaper vs expensive index funds that track the same index Why does every T-800 Terminator sent back look like this? his comment is here Oracle technology is changing and we strive to update our BC Oracle support information.

A crime has been committed! ...so here is a riddle Mysterious cord running from wall. Not A Single-group Group Function Avg Not the answer you're looking for? Results 1 to 3 of 3 Thread: not a single-group group function-HELP???

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. I cant really accept a comment as an answer so i guess ill just accept your answer. –Tomek Nov 25 '09 at 7:49 add a comment| up vote 8 down vote You cannot refer to a nonaggregated column in SELECT that is not also named in the GROUP BY clause. Nested Group Function Without Group By Powered by vBulletinCopyright ©2000 - 2016, Jelsoft Enterprises Ltd.Forum Answers by - Gio~Logist - Vbulletin Solutions & Services Home Register New Posts Advertising Archive Privacy Statement Sitemap Top Hosting and Cloud

I have tried using group by instead of order by but then it tells me that its not a group by expression. Thank you in advance. Why does Russia need to win Aleppo for the Assad regime before they can withdraw? weblink Please re-enable javascript in your browser settings.

Browse other questions tagged sql database oracle-sqldeveloper or ask your own question. Also describe what do you want in words. –JSapkota Apr 11 at 2:28 Seconded. Try to take the SQL out and run it in SQL*Plus until it works again. Action: Drop either the group function or the individual column expression from the SELECT list or add a GROUP BY clause that includes all individual column expressions listed.

Why don't VPN services use TLS? How to securely erase with Disk Utility on El Capitan & Sierra What happened to the "greater enemy" plot of Old Republic series? How to \immediate\write with multiple lines?