Home » SQL & PL/SQL » SQL & PL/SQL » what is error in below query (oracle 10g)
what is error in below query [message #582527] Fri, 19 April 2013 02:44 Go to next message
pankajdurve
Messages: 18
Registered: April 2013
Location: MUMBAI
Junior Member
select e.department_id,d.department_name,count(*) from hr.employees e group by department_id
join
hr.departments d on
e.department_id=d.department_id
Re: what is error in below query [message #582528 is a reply to message #582527] Fri, 19 April 2013 02:58 Go to previous messageGo to next message
Littlefoot
Messages: 19630
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Is it a quiz?

Wrong syntax. GROUP BY should go to the end of this query; it should contain all non-aggregate columns.
Re: what is error in below query [message #582529 is a reply to message #582527] Fri, 19 April 2013 02:59 Go to previous messageGo to next message
dariyoosh
Messages: 532
Registered: March 2009
Location: Iran / France
Senior Member
Take a look at query block ::= and you will see what is the problem.


Regards,
Dariyoosh
Re: what is error in below query [message #582533 is a reply to message #582527] Fri, 19 April 2013 03:17 Go to previous message
Michel Cadot
Messages: 59146
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.

Regards
Michel
Previous Topic: Oracle 11g function error
Next Topic: How to Delete files from EXT Table Dir through SQL PLUS
Goto Forum:
  


Current Time: Sat Sep 20 11:33:09 CDT 2014

Total time taken to generate the page: 0.07386 seconds