Results 1 to 6 of 6

Thread: Group by Clause in oracle DBMS

  1. #1
    Join Date
    Jan 2010
    Posts
    63

    Group by Clause in oracle DBMS

    Hello & good Morning to all !!

    I am unable to know the concept of Group by clause. I need your help to know about this concept. I will be very thankful to know about this. The problem is that, I have a query to access the counts of certain data from a table,I need to display two of the values and the others I would like to group them.

    Thanks.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Group by Clause in oracle DBMS

    Group by Clause :

    The Group by Clause is being used to make the group of one or more than one columns which will produce the results in a sorted order of GROUP BY columns.

    It is actually used to get data form the table in a sorted form.But it is always recommended to use the ORDER BY clause with the GROUP BY when ever the sorting is required.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Syntax of Group by Clause in oracle DBMS

    Syntax Group by Clause :

    You can implement the GROUP BY clause whenever you requires the sorting of data and you can implement it like this way using syntax :

    SQL> SELECT <column_name>, <aggregating_operation>
    FROM <table_name>
    GROUP BY <column_name>;

    Using this syntax,you can implement it with the required statement to access the sorted data from database objects.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Implementing Group by Clause in oracle DBMS

    Implementing Group by Clause :

    You can implement the GROUP BY clause with the statement when you need to use.I am going to show you an example which will show how to implement :

    Code:
    SELECT dept_id, dept_owner, SUM(sales) as "Total sales"
    FROM order_details
    GROUP BY dept_id, dept_owner
    ORDER BY dept_id;
    In the above example,two columns are being used to sort the required data with the GROUP BY clause.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    ORDER BY Clause in oracle DBMS

    ORDER BY Clause :

    The ORDER BY clause is being used to sort the records in your result set.It is used only with SELECT statements.To view the syntax of the ORDER BY clause is given below :

    Code:
    SELECT <column_name,....>
    FROM <table_name>
    WHERE (...predicates...)
    ORDER BY column ASC/DESC;

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    ASC and DESC with ORDER BY Clause in oracle DBMS

    ASC and DESC with ORDER BY Clause :

    The ASC and DESC option specifies the type of sorting. The column which is added with ORDER BY clause.These options are used to make a set of order of those values which reside in the columns.

    The ASC sorts the values in Ascending order and DESC sorts in descending order.If you omit this option with Order clause then the ASC will take place as default option.

Similar Threads

  1. Problem of WHERE clause in SQL statement
    By Macario in forum Software Development
    Replies: 4
    Last Post: 15-10-2010, 08:02 AM
  2. DreamCoder for Oracle DBMS
    By Gerri in forum Windows Software
    Replies: 4
    Last Post: 08-02-2010, 08:38 PM
  3. Use the CASE Statement in a SQL SELECT Clause
    By Abraham.J in forum Software Development
    Replies: 3
    Last Post: 12-08-2009, 01:52 PM
  4. ORACLE is a DBMS or RDBMS
    By vinodpathak_214 in forum Software Development
    Replies: 5
    Last Post: 06-02-2009, 04:48 PM
  5. XML vs DBMS
    By Neider in forum Hardware Peripherals
    Replies: 4
    Last Post: 15-10-2008, 06:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,546,958.33747 seconds with 17 queries