Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A query regarding using GROUP BY using Oracle as DataBase

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ,

Can anybody give me a clear idea on using GROUP BY Syntax :

Here is the sample syntax , which i am currently using :

SELECT column_name, SUM(AMOUNT)
FROM TRANSTABLE
WHERE column_name operator value
GROUP BY column_name


Please let me know what is the column name that should be supplied in case of column_name (In first Line of Query)

Can we use any Column name here or it should meet any specific conditions ??

Please share your ideas , thanks in advance .




 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any field you want to group the result set by, should be selected..
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!