How to concatenated columns group by clause

with apps AS (
SELECT 'a' AS APP_ID,1 AS RANK FROM DUAL
UNION
SELECT 'a' AS APP_ID,2 AS RANK FROM DUAL
UNION
SELECT 'a' AS APP_ID,3 AS RANK FROM DUAL
UNION
SELECT 'b' AS APP_ID,4 AS RANK FROM DUAL
UNION
SELECT 'b' AS APP_ID,5 AS RANK FROM DUAL
UNION
SELECT 'c' AS APP_ID,6 AS RANK FROM DUAL
SELECT APP_ID,RANK FROM apps ORDER BY 2;
A RANK
a 1
a 2
a 3
b 4
b 5
c 6
6 rows selected.
concatenated_column
a,1, 2,3
b,4, 5
c,6

Few days earlier someone has posted this - i think this might help u---
CREATE OR REPLACE FUNCTION scott.rowtocol(p_slct IN VARCHAR2,p_dlmtr IN VARCHAR2 DEFAULT ',')
RETURN VARCHAR2 AUTHID CURRENT_USER
AS
  TYPE c_refcur IS REF CURSOR;
  lc_str VARCHAR2 (4000);
  lc_colval VARCHAR2 (4000);
  c_dummy c_refcur;
BEGIN
  OPEN c_dummy FOR p_slct;
  LOOP
    FETCH c_dummy
    INTO lc_colval;
    EXIT WHEN c_dummy%NOTFOUND;
    lc_str := lc_str || p_dlmtr || lc_colval;
  END LOOP;
  CLOSE c_dummy;
  RETURN SUBSTR (lc_str, 2);
END;
SELECT DISTINCT a.job,
                rowtocol
                ( 'SELECT ename FROM emp WHERE job = '
                  || ''''
                  || a.job
                  || ''''
                  || ' ORDER BY ename'
                ) AS employees
FROM emp a;
JOB                  EMPLOYEES
SALESMAN      ALLEN,MARTIN,TURNER,WARD
CLERK             ADAMS,Avik,BARRY,MILLER,Roni,prithwi
ANALYST         FORD,SCOTT
PRESIDENT      KING
MANAGER        BLAKE,CLARK,JONESRegards.
Satyaki De.

Similar Messages

  • How to set a group by clause in ODI interface?

    How to set a group by clause in ODI interface?

    In ODI, group by method will be triggered automatically when any one of your mapping contains aggregate functions.
    Thanks,
    Saravanan Rajavel

  • How to ALV Column Group?

    Hello all,
                  Can ALV setting column group as below?
    Example
    Group : JAN
    Column : Qty, Amt, Avg
    Group : FEB
    Column : Qty, Amt, Avg
    Group : MAR
    Column : Qty, Amt, Avg
    Group : DEC
    Column : Qty, Amt, Avg
    Regard,
    Susan.HRB
    Edited by: HRB Susan on Oct 14, 2009 9:23 AM
    Edited by: HRB Susan on Oct 14, 2009 9:31 AM
    Edited by: HRB Susan on Oct 14, 2009 9:33 AM
    Edited by: HRB Susan on Oct 14, 2009 9:41 AM
    Edited by: HRB Susan on Oct 14, 2009 9:41 AM

    Hello ,
    I understand that yours is a requirement related to alv tree display...
    You could group the columns at the field where you want to display the tree format and use the function module reuse_alv_tree_display to display the fields in tree format'.
    Thanks

  • GROUP BY Clause -SQL Devolper error 00904. 00000 -  "%s: invalid identifier

    I'm a real novice with SQL and I am having a problem understanding why this doesn't work. Searching the web got me to this forum, but I haven't been able to find a solution. Obviuosly I don't really understand how to use the GROUP BY clause. The SQL works fine without that clause.
    As stated in the subject I am getting this error:
    ORA-00904: "SORTPLAN": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action:
    Error at Line: 9 Column: 17
    With this SQL statement:
    SELECT START_DTM,
    END_DTM,
    MACHINE_SORT_PROGRAM_NAME as Sortplan,
    sum(TOTAL_PIECES_FED_CNT) AS TotalFed
    FROM END_OF_RUN
    WHERE MODS_DATE BETWEEN '27-Jul-2011' AND '27-Jul-2011'
    AND MAIL_OPERATION_NBR =919
    AND SITE_ID = 81003
    GROUP BY Sortplan
    ORDER BY Sortplan;
    TIA
    Mike

    Gary,
    Thank you for pointing me in the right direction. There are so many choices here I had a hard time deciding which to use. :)
    I tried your suggestion and still got an error. I had thought I didn't need to use aggregate functions on all of the fields. I guess that was wrong, so I changed it. Once I did that the SQL worked fine.
    ORA-00979: not a GROUP BY expression
    00979. 00000 - "not a GROUP BY expression"
    *Cause:   
    *Action:
    Error at Line: 2 Column: 3
    SELECT MACHINE_SORT_PROGRAM_NAME AS Sortplan,
    min(START_DTM),
    max(END_DTM),
    sum(TOTAL_PIECES_FED_CNT) AS TotalFed
    FROM END_OF_RUN
    WHERE MODS_DATE BETWEEN '27-Jul-2011' AND '27-Jul-2011'
    AND MAIL_OPERATION_NBR =919
    AND SITE_ID = 81003
    GROUP BY MACHINE_SORT_PROGRAM_NAME
    ORDER BY Sortplan;
    Mike

  • How to ORDER BY Different column than in the group by clause.

    Hello, I have this sql statement
    SELECT COUNT([Tags]) AS CNT, [Tags]
    FROM [Tags], [Images]
    WHERE
    ([Images].[Tags] LIKE '%' + [Tags].[LongTag] + '%') AND
    ([Tags].AllowTagPost = 'True' )
    GROUP BY [Images].[Tags]
    HAVING COUNT([Tags]) > 30
    ORDER BY [Tags].[LastTagPost] DESC
    It returns the tags, the number of occurances sorted by count.  However, I want to sort it by a column in the Tags table named LastTagPost (DATETIME)  The idea is to get the tag that hasn't been used in the longest time and also has more occurances
    than 30 in the image table.  When I try to order by this column i get an error that i'm sure most of you are all to familer with.
    Error:
    Column "Tags.LastTagPost" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.
    Any help would be greatly appreciated.

    Couldn't you just include the LastTagPost as a MIN?
    DECLARE @tags TABLE (LastTagPost DATETIME, LongTag VARCHAR(100), allowTagPost CHAR(5))
    DECLARE @images TABLE (tags VARCHAR(10))
    SELECT COUNT(i.Tags) AS CNT, i.Tags, MIN(t.LastTagPost) AS lastTagPost
    FROM @Tags t
    INNER JOIN @Images i
    ON i.Tags LIKE '%' + t.LongTag + '%'
    WHERE t.AllowTagPost = 'True'
    GROUP BY i.Tags
    HAVING COUNT(i.Tags) > 30
    ORDER BY LastTagPost DESC
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • How to display column specified in group by clause only once?

    I've a result coming out of a sql query that uses group by clause as follows:
    2008-07-25 19" LCD Screen 5
    2008-07-25 HP Printer     4
    2008-08-01 Hanging Files 11
    2008-08-01 Stapler     3
    2008-08-15 19" LCD Screen 5
    2008-08-15 Hanging Files 14
    What should I do in the query to display the result set as follows:
    2008-07-25 19" LCD Screen 5
         HP Printer     4
    2008-08-01 Hanging Files 11
         Stapler     3
    2008-08-15 19" LCD Screen 5
    Hanging Files 14

    Hi,
    That's a display issue, and display issues are best handled by the front end.
    What is your frone end?
    If it's SQL*Plus, you can use the BREAK command.
    For example:
    BREAK ON  deptno     NODUPLICATES
    SELECT       deptno
    ,       ename
    FROM       scott.emp
    ORDER BY  deptno
    ,            ename
    ;Output:
    `   DEPTNO ENAME
            10 CLARK
               KING
               MILLER
            20 ADAMS
               FORD
               JONES
               SCOTT
               SMITH
            30 ALLEN
               BLAKE
               JAMES
               MARTIN
               TURNER
               WARDNote that deptno is never NULL: KING and MILLER have deptno=10; but it doesn't show in the display, because it's the same as the deptno on the previous row.
    NODUPLICATES is actually the default, so you could just say
    BREAK ON deptnoThe BREAK command remains in force until you end the session (or un-do it, e.g. with "CLEAR BREAKS")
    Remember to issue the BREAK command at least once in the session before running the query.
    To get the same results in SQL, use the analytic ROW_NUMBER function.

  • OBIEE Group By on 2 facts and concatenated columns from different dimensions

    Hi
    I have a different kind of problem involving 2 fact tables with different dimensional attributes.
    Fact 1 has Dim Attributes ( Cust,Facility )
    Measure - Gross Amount
    Fact2 has Dim attributes (Cust,Facility and Risk Group )
    Measure : Exposure Amount
    Since we have 2 facts with different dimensions,
    to exclude the 'Risk Group' dimension column from the group by for the Fact1,
    we set the 'Gross Amount' measure to total level (Risk Group Dimension ) in contents tab.
    So the values from both the fact tables appears in the same report correctly.
    But in the same report we have another requirement where the rating column from the customer dimension has to be concatenated with the ratings column in the facility dimension.
    We have to concatenate customer.rating with the facility.rating and display it in the report.
    when we just pull the individual columns from the dimensions into the report it works fine.
    But when we try to concatenate the 2 columns and show it in the report,
    the concatenated column does not appear in the select or the group by in the SQL Fact2.( Generated by OBIEE )
    The other fact1 has the concatenated column in the select as well as the group by clause ( Generated by OBIEE )
    As a result the report shows the concatenated values only for the results from the Fact1. But the results from Fact2 does not have the concatenated column values.
    The report should look like the below:
    Custor.Name,     Customer.Id,     Facility.Name,     Facility.Id,     Customer.Rating/Facility.Rating,     Risk Group,     Gross Amount,     Exposure Amount
    ===========    =========      ===========     =========   ========================      =========     ===========     ===============
    JPMC                123                    GROSS               123               08/10                                                  LNL                    45,000               25,000
    CLAIRE               456                    NET                    456               07/10                                                  RNK                    50,000               30,000
    Thanks,
    Chandra

    As suggested you really want to move your none-aggregated fact attributes to a logical dimension (using the same physical table as the logical fact). Map this in the BMM layer as a snowflake, Place a hierarchy on this dimension with (at minimum) Total -> Detail levels, then on the other fact table you want to include in the report, set the content level on your other fact measures to the 'Total' level for your new logical Dim and it will allow them to be present in the same report.

  • How to use order by within Group by clause

    Hi All,
    I need a help as to how should i use the Order by clause so that the data should be in order with respect to one column, and at the same time whole data is grouped by some other column...like
    Select RaceNo,Venue,FP,BP from Race group by RaceNo
    Here I want to order by FP in ascending order for each group. When i am using it , whole order is changing.
    Can anybody suggest me how to use order by clause that would apply to each group of data.
    Thanks .

    order by clause should be used at the last in any query.......but in group by clause u can't use use that becoz u group according to column then no ordering is needed there......if u want to filter something then u can use having clause and later if u need to arrange then u can use order by clause.........
    i hope this eg.l gives u some clarification....
    e.g
    select deptno,count(empno)
    from dept
    group by deptno
    having count(empno) > 10
    order by deptno

  • Creation of view with clob column in select and group by clause.

    Hi,
    We are trying to migrate a view from sql server2005 to oracle 10g. It has clob column which is used in group by clause. How can the same be achived in oracle 10g.
    Below is the sql statament used in creating view aling with its datatypes.
    CREATE OR REPLACE FORCE VIEW "TEST" ("CONTENT_ID", "TITLE", "KEYWORDS", "CONTENT", "ISPOPUP", "CREATED", "SEARCHSTARTDATE", "SEARCHENDDATE", "HITS", "TYPE", "CREATEDBY", "UPDATED", "ISDISPLAYED", "UPDATEDBY", "AVERAGERATING", "VOTES") AS
      SELECT content_ec.content_id,
              content_ec.title,
              content_ec.keywords,
              content_ec.content content ,
              content_ec.ispopup,
              content_ec.created,
              content_ec.searchstartdate,
              content_ec.searchenddate,
            COUNT(contenttracker_ec.contenttracker_id) hits,
              contenttypes_ec.type,
              users_ec_1.username createdby,
              Backup_Latest.created updated,
              Backup_Latest.isdisplayed,
              users_ec_1.username updatedby,
              guideratings.averagerating,
              guideratings.votes
         FROM users_ec users_ec_1
                JOIN Backup_Latest
                 ON users_ec_1.USER_ID = Backup_Latest.USER_ID
                RIGHT JOIN content_ec
                JOIN contenttypes_ec
                 ON content_ec.contenttype_id = contenttypes_ec.contenttype_id
                 ON Backup_Latest.content_id = content_ec.content_id
                LEFT JOIN guideratings
                 ON content_ec.content_id = guideratings.content_id
                LEFT JOIN contenttracker_ec
                 ON content_ec.content_id = contenttracker_ec.content_id
                LEFT JOIN users_ec users_ec_2
                 ON content_ec.user_id = users_ec_2.USER_ID
         GROUP BY content_ec.content_id,
         content_ec.title,
         content_ec.keywords,
         to_char(content_ec.content) ,
         content_ec.ispopup,
         content_ec.created,
         content_ec.searchstartdate,
         content_ec.searchenddate,
         contenttypes_ec.type,
         users_ec_1.username,
         Backup_Latest.created,
         Backup_Latest.isdisplayed,
         users_ec_1.username,
         guideratings.averagerating,
         guideratings.votes;
    Column Name      Data TYpe
    CONTENT_ID     NUMBER(10,0)
    TITLE          VARCHAR2(50)
    KEYWORDS     VARCHAR2(100)
    CONTENT          CLOB
    ISPOPUP          NUMBER(1,0)
    CREATED          TIMESTAMP(6)
    SEARCHSTARTDATE     TIMESTAMP(6)
    SEARCHENDDATE     TIMESTAMP(6)
    HITS          NUMBER
    TYPE          VARCHAR2(50)
    CREATEDBY     VARCHAR2(20)
    UPDATED          TIMESTAMP(6)
    ISDISPLAYED     NUMBER(1,0)
    UPDATEDBY     VARCHAR2(20)
    AVERAGERATING     NUMBER
    VOTES          NUMBERAny help realyy appreciated.
    Thanks in advance
    Edited by: user512743 on Dec 10, 2008 10:46 PM

    Hello,
    Specifically, this should be asked in the
    ASP.Net MVC forum on forums.asp.net.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Columns not to be included in group by clause

    I have a select query where i need to display count of records group by state_name
    In my main select query i need to include two more columns which are not be included in group by clause so that the number of records displayed does not increase
    I need to pass all these values from front end application so that i get count of records only by statename
    But when i include these two columns in my select query my query is throwing an error bcoz i have not included them in my group by
    How can we prevent this by not adding it to group by clause

    One general approach is (using the emp dept example)
    I want
    deptno dname, count(distinct empno)
    I can do that
    select d.deptno, d.dname, count(distinct e.empno)
    from dept d, emp e
    where e.deptno=d.deptno
    group by d.deptno, d.dname;
    or
    select d.deptno, d.dname, count_emp
    from dept d,
    (select e.deptno, count(distinct empno)
    from emp e
    group by e.deptno
    where d.deptno = e.deptno
    or depending on version (you don't mention versionk, though most questions have version dependent answers)
    select deptno
    , dname
    , (select count(distinct empno) from emp e where e.deptno=d.deptno)
    from dept d
    Obviously you can also use the FIRST and the LAST function to avoid having to include a column in the GROUP BY clause.
    Sybrand Bakker
    Senior Oracle DBA

  • Can't understand how this group by clause works

    The Schema is as below: (http://www.psoug.org/reference/rollup.html)
    CREATE TABLE grp_rep (
    person_id NUMBER(3),
    division VARCHAR2(3),
    commission NUMBER(5));
    INSERT INTO grp_rep VALUES (1,'SAM',1000);
    INSERT INTO grp_rep VALUES (2,'EUR',1200);
    INSERT INTO grp_rep VALUES (1,'EUR',1450);
    INSERT INTO grp_rep VALUES (1,'EUR',700);
    INSERT INTO grp_rep VALUES (2,'SEA',1000);
    INSERT INTO grp_rep VALUES (2,'SEA',2000);
    INSERT INTO grp_rep VALUES (1,'EUR',800);
    COMMIT;
    Query1:
    SELECT person_id, division, SUM(commission)
    FROM grp_rep
    GROUP BY person_id, ROLLUP (person_id, division);
    Query2:
    SELECT person_id, division, SUM(commission)
    FROM grp_rep
    GROUP BY division, ROLLUP (person_id, division);
    The results of query1 are okay. It has results from rollup and group by person_id.
    But, in Query2 results of rollup are missing and results of group by division is there.
    Anyone can explain how the group by clause works when there are multiple columns involving CUBE, ROLLUP and simple column names?
    Regards.

    Thank you shoblock!
    but, What i m really looking for is,
    How group by clause works when i add regular column along with RollUp in group by clause?
    I have understood simple group by clause like
    ...group by column1,column2,column3....
    n I also know simple rollup clauses like
    ...group by rollup(column1,column2,column3,...)
    But my Problem is how does this work:
    ...group by column2,rollup(column1,column2,...)
    ...group by column1,rollup(column1,column2,...)
    See below Results:
    Query1:
    SELECT person_id, division, SUM(commission)
    FROM grp_rep
    GROUP BY person_id,ROLLUP ( person_id, division );
    Result:
    PERSON_ID DIVISION SUM(COMMISSION)
         1      EUR      2950
         1     SAM      1000
         2      EUR      1200
         2      SEA      3000
         1           3950
         2           4200
         1           3950
         2           4200
    SELECT person_id, division, SUM(commission)
    FROM grp_rep
    GROUP BY division,ROLLUP ( person_id, division );
    Query2:
    SELECT person_id, division, SUM(commission)
    FROM grp_rep
    GROUP BY division,ROLLUP ( person_id, division );
    Result:
    PERSON_ID DIVISION SUM(COMMISSION)
    1 EUR 2950
    2 EUR 1200
         1 SAM      1000
    2 SEA 3000
    1 EUR 2950
    2 EUR 1200
    1 SAM 1000
    2 SEA 3000
    EUR 4150
    SAM 1000
    SEA 3000
    guys, help me make understand above results!
    Regards.

  • Select columns not in group by clause

    Hi Guys,
    I want to fetch columns from a table which are not in group by clause. The catch here is that I also need a count and decode column..
    SELECT col_A, col_B, decode(col_C, '10', '10', '26', '26', '00') col_CT, col_X, col_Y count(*) CNT
    FROM TABLE_T
    WHERE col_B IN (100,101,102) AND col_C IN ('44','45','10','26')
    GROUP BY col_A, col_B, decode(col_C, '10', '10', '26', '26', '00')
    ORDER BY col_CT
    Since, col_X and col_Y are not in GROUP BY clause, it throws error. Also, decode/count of the columns makes it more complex.
    Please help me on this.
    Thanks,
    Amy

    Hi, Amy,
    Welcome to the forum!
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statments, relevant columns only) for all tables involved, and the results you want from that data.
    Always say which versionof Oracle you're using.
    How to do what youy want depends on what you want, which is unclear.
    If you say "GROUP BY a, b, c", that means you only want one row of output for each distinct combination of a, b and c. How do x and y fit into that? Do you want a separate output row for each distinct combination of a, b,c, x and y? Then add x and y to the GROUP BY clause. If you don't want separate rows for each combinataion of x and y, what do you want when a group has more than 1 value for either of them?
    You can simplify the code a little by doing the DECODE in a sub-query; then you can use the alias col_ct as many times as you like in the main query. That will make the code easier to maintain, too.

  • How to create RunningValue Through Column Groups?

    Hi Everybody i´m trying to do this with a Matrix
    I want the running value of the product quantity for each month of a year,
    resetting the running value
    when a new year is reached
    I have 2 column groups "Year" and as it´s child group "Month".
                         2009                                  
    2010
                         January Febrary March      January   February  March
    Product
    Toolbelt            10           15       20             
    1            10            50
    Well that is the idea...
    In the field of the quantity i´m using an expression like this = RunningValue(Fields!Quantity.Value, Sum, Nothing) .
    With this expression i get the the running value and it´s great, but
    it does not reset thru the years ,
    it continues aggregating the quantity value.
    So i tried with this expression assuming if i set the SCOPE to the Year group i can achieve this
    = RunningValue(Fields!Quantity.Value, Sum, "Year") ,
    But surprise!!, this is not giving me the right aggregation , i´m still dig in it and can´t find what it actually aggregates.
    Am I doing something wrong?.
    All the help is welcome. Thanks.

    Hi UzielB,
    Based on your information, I get your requirement completely, here you want to accumulate the value of month from
    Jan to March whin one year, then return to Jan again whin another year. If I misunderstand you please do not hesitate to let me know.
    Now the issue you are encountering is that the value does not reset through the different years.
     Actually, nomatter it is 2009 or 2010, RunningValue function takes different years as the same scope, so the value does not reset
     through the different years. Just like picture3.
    To workaround the issue, we might need to utilize the subreport in the main report, for detailed steps please follow
    these:
    1.    
    Design the subreport with two column groups
    Year, Month and one row group Product.
    2.    
    Type in the expression in the data textbox
    =RunningValue(Fields!Yourdatafield.Value,sum,"Product") Here
    Product is the row group name.
    3.    
    Add one parameter
    Year to the subreport, of course you should add the parameter year behind the where clause in the T-sql. Such as
    select * from yourtable where Year=@Year
    4.    
    Delete the
    Year column and Product column, here please make sure you just delete the column only rather than deleting the relevant reportitem.
    5.    
    Decrease the height and width of the report to the report control size, then there is no blank space when displayed in the main report.
    6.    
    Drag a matrix to the main report, just add one column group
    Year.
    7.   
    Then drag a subreport control into the data textbox, and then rigth-click the subreport control->select subreport
    properties
    8.   
    In the Subreport Properties dialogbox, please selec the subreport name in the drop-down list of
    Use this report as a subreport
    9.    
    Swith to
    Parameter tab, click Add button to add a parameter, then select the
    Year in the Name drop-down list and
    Year datafield in the Value drop-down list.
    10.  
    Click OK.
    11.  
    Now add another table control into the 
    main report body with one column, and drag the product datafiled into the data textbox. Then group the table by
    Product.
    12.  
    Drag this table into the
    Rows  textbox of the main report. Here make sure the height of the rows in Subreport and table creted in step11 is the same, otherwise the lines in not stay in the same level.
    Preview the report, you will see the report like picture2.
    If you have any question about the steps, please feel free to ask.
    Have a wonderful day
    J
    Challen Fu

  • How to include case stmt in group by clause

    Hi i have a question,
    How do i include a case statement in the group by clause?
    For example:
    Select
    (case when x.ctry is null then y.ctry else x.ctry end) as coo,
    sum (x.in_amt)
    from
    tbl1 x,
    tbl2 y
    where
    x.id = y.id
    group by
    (case when x.ctry is null then y.ctry else x.ctry end)
    Assume, I have got millions of records in both the tables, then my guess is, the above query might take huge time to complete.
    Any alternate method to do this?

    cd/ wrote:
    To remove the expression from the GROUP BY clause. I didn't advocate any performance improvements, did I?No you didn't. And your advice can indeed remove the expression from the GROUP BY clause. But I'm still puzzled as to why that would be a goal in itself.
    Regards,
    Rob.

  • More than 1 column in the group by clause

    DB Version:10gR2
    I understand the basics of GROUP BY clause. I have a question on why we have on more than 1 columns in GROUP BY clause.
    In the below example, the course name by itself does not make up a group. A Course name plus its BeginDate make up a group. This is the whole point of having more than 1 columns in the GROUP by clause. Right?
    SQL> select r.course, r.begindate , count(r.attendee) as attendees
      3   from registrations r
      4   group by r.course, r.begindate
      5   order by course
      6  /
    COURSE BEGINDATE      ATTENDEES
    JAVA    12/13/1999           5
    JAVA    2/1/2000             3
    OAU     8/10/1999            3
    OAU     9/27/2000            1
    PLS     9/11/2000            3
    SQL     4/12/1999            4
    SQL     10/4/1999            3
    SQL     12/13/1999           2
    XML     2/3/2000             2

    ExpansiveMind wrote:
    Thanks Dmorgan. I am just learning the basics of GROUP BY clause. I have noticed that all Non-aggregate columns in SELECT list have to be present in the GROUP BY clause. I thought it was a "syntactical requirement". Now, i realise that these columns are present in the GROUP BY clause because only a combination of columns make up a group.Well, it is a bit of both actually. It is a syntactic requirement that all non-aggregated columns in the select list must appear in the group by clause. However, the non-aggregated columns in the select list is what defines your group. Your two examples define two different groups, and would answer two different questions.
    John

Maybe you are looking for

  • 10.5.6 Update Issue with Time Machine

    I updated my MacBook Pro 2.4GHz Core 2 Duo from 10.5.5 to 10.5.6 yesterday and since then I have been unable to complete a Time Machine backup to my Time Capsule. It always gives me a status message "Preparing." I have already restarted my computer a

  • Itunes Installation Damaged Error Windows 7

    For weeks Itunes has been begging me to update my software to the new software which i didn't do until yesterday. As i did, all my music except music i bought off of itunes was gone, just gone. my playlists were all gone and the layout of the itunes

  • Error Message when installing IPHOTO 4.0

    I had to purchase IPHOTO 4.0 because Apple no longer supports IPHOTO 2.0 for Mac photo books. When I tried to install IPHOTO 4.0 this message appears "This installation cannot proceed because one of the following applications is running - ITUNES, IPH

  • Coloring a field in the internal table

    Hi all, How can I color a field in the internal table knowing that I'm developing a classic report. Thanks in advance.

  • Image issue when printing

    I use Adobe Acrobat 9 Pro. In my job I am responsible for training materials. I often convert pptx or docx into pdfs and never had a problem with images but now I do. PDFs show as being successful and everything looks good on the screen but once I pr