Problem trying to use a group by clause

hey good day,
i'm trying to use a group by clause in my application, but I'm getting the following error.
Error:-  Query cannot be parsed, please check the syntax of your query. (ORA-00979: not a GROUP BY expression)
select      "INSTRUCTOR"."EMPNUM",
      "INSTRUCTOR"."FIRSTNAME",
      "INSTRUCTOR"."LASTNAME",
      "QUALN"."SPECIALIZE_FIELD" as "SPECIALIZE_FIELD",
         "INSTRUCTOR"."USERNAME"
from      "QUALN" "QUALN",
      "INSTRUCTOR" "INSTRUCTOR"
where   "INSTRUCTOR"."EMPNUM"="QUALN"."EMPNUM"
group by "INSTRUCTOR"."EMPNUM", "INSTRUCTOR"."FIRSTNAME", "INSTRUCTOR"."LASTNAME"Thanks in advance,
Richie

Richie wrote:
hey thanks for your reply,
i have tried what you have suggested, but now i got another error
Error :- The report query needs a unique key to identify each row. The supplied key cannot be used for this query. Please edit the report attributes to define a unique key column. ORA-01446: cannot select ROWID from, or sample, a ...
This error message is not from oracle, btu from your reporting tool. it might be MS Access or whatever other tool that you use. Some of these tools want a unique value to identify the current row. The logic applied depends on the relationship of your tables. however in your case you could do it without the group by condition. THen the rowid can still be applied to your query.
Example
note the usage of alias names to simplified the select
select      i.EMPNUM ,
      i.FIRSTNAME ,
      i.LASTNAME ,
         i.USERNAME
from      INSTRUCTOR i
where   i.EMPNUM in (select q.EMPNUM from QUALN q);

Similar Messages

  • I am trying to use tab groups. My problem is that everytime I restart Firefox any groups I made in the previous session disappear. How do I stop this from happening?

    I am trying to use tab groups. My problem is that everytime I restart Firefox, any tab groups I made in the previous session are no longer there. How do I stop this from happening?

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Hi can anybody help please. I am having terrible problems trying to use my Nikon D7100 to tether. I have downloaded the latest Lightroom updates and also checked my firmware which is also the latest avaiable and still Lightroom wont detect my camera!

    Hi can anybody help please. I am having terrible problems trying to use my Nikon D7100 to tether. I have downloaded the latest Lightroom updates and also checked my firmware which is also the latest avaiable and still Lightroom wont detect my camera!. When I use a friends Canon camera it works every time!

    Hi Keith thanks for your reply I have Lightroom 5.7.1 64 bit and my Nikon's firmware is version 1.02

  • Problem with the query in group by clause

    hi, i have problem with group by clause, can some one please help me.
    select
    header_id,
    (select sum(nvl(dr,0) - nvl(cr ,0)) from temp_tab a1
    where
    a1.country=a.country
    and a1.source='AP'
    and a1.header_id=a.header_id) WHT,
    sum(dr),
    sum(cr) from temp_tab a
    group by header_id,
    (select sum(nvl(dr,0) - nvl(cr ,0)) from temp_tab a1
    where
    a1.country=a.country
    and a1.source='AP'
    and a1.header_id=a.header_id)
    select * from temp_tab
    drop table temp_tab
    create table temp_tab(header_id number ,line_num number, country varchar2(2),
    source varchar2(2), dr number, cr number,primary key(header_id,line_num));
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(1, 1,'NL','AP',100,20);
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(1, 2,'PO','AP',20,20);
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(1, 3,'NL','AP',70,20);
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(2, 1,'NL','PA',100,20);
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(2, 2,'NL','PA',100,20);
    insert into temp_tab(header_id, line_num,country, source, dr,cr) values(3, 1,'KR','PO',100,20);
    commit;
    Appreciate your help.
    Thanks,

    select header_id,
             (select sum(nvl(dr,0) - nvl(cr ,0)) from temp_tab a1
             where a1.country=a.country
             and a1.source='AP'
             and a1.header_id=a.header_id) WHT,
             sum(dr),
             sum(cr)
      from temp_tab a
    group by header_id
    ,countryIt's kinda hard to follow what your query does... maybe because I'm only at my second coffee..
    Edited by: Alex Nuijten on Oct 2, 2009 8:07 AM

  • Problems, trying to use backup from 5.1.1 iOS Gen 3 iPod does not sync music to 4th gen iOS 6 iPod.

    My 3rd Gen iPod's headphone connector is basically shot, I've had it for around if not over two years now; sometimes I'm surprised it lasted this long; since I am not one who usually listens to her music without headphones, this is problematic, .
    Luckily, a family memberI know had a gen 4 iPod, 32g, same space amount as my old one, lying around that they don't use anymore, thank goodness.
    Well, in one case, not so much. First of all, said iPod was locked with a passcode (the passcode was guessed so many times because no one could remember it, it locked permenantly) so I had to completely wipe it. However, it wasn't so bad, though all the information was lost, I could finally use iOS 6 on an iPod.
    Well, iOS turned out to be a huge problem, in the way of synicing my old backup. I have about, um, an estimated 3000 songs on my 3rd gen iPod, that of which are not all on one computer, and are from multiple computers (my desktop / laptop); I thought all the songs would transfer over with the rest of my things. I didn't think the iOS made a difference.
    Lo and behold, I was dead wrong.
    When my iPod was restored to my previous backup, it had no music, only my pictures and apps were added. I'd call 'it annoyed me' an understatement. I waited all that time for the ipod to restore and the backup to finish, only to get my one hundered pictures and two apps.
    I have tried to look up how to extract music from my iPod, but to no avail, my computer recognizes it as a camera and I can only access the picture files; the way I read you have to do it online, you must be able to actually get into the iPod's folders, besides the picture folders, and I can't seem to do that; there was an option in earlier versions of iTunes that allowed the iPod device to be displayed as something other than a camera but it no longer seems to be an option in the new iTunes.
    All the programs for extracting files, specialized for iPod file extraction, actually, cost money, which at the moment, I don't have much of, this iPod was given to me by a family member, and I'm lucky I even have it. Manual extraction is also something I've tried but failed miserably at, as mentioned earlier.
    I'm really not up for re-synching one by one, I want this to be as quick and painless as possible. I have the available GB for my 3000 songs (I checked). Most of my songs are mp3s, and some are m4as. Not everything is bought, and not everything is going to be able to be downloaded through iCloud on account of the fact that there are, uh, over 2GB worth of songs, so does anyone have any solutions to my problem here? I have over 50gb in my desktop library alone, loads more in my laptop library, and I really don't feel like separating all the songs from my previous iPod into a single playlist, if there's a more efficient, free solution out there....
    This would not have been a problem in the first place, if the passcode was not there; but blame the previous owner of the 4th gen iPod for that. She typed it so many times it locked her out. And so, I had to reset, but not without an automatic update for iOS 6, which my gen3 can't update to, because it's, well, outdated.

    Connect the iPod to your computer and update to iOS 6.1.3. You need iTunes 10.7 or later on the computer.
    iOS 4: Updating your device to iOS 5 or later

  • Problems trying to use built-in OWB 11.2 on Oracle RDBMS 11.2 (64 bit)

    I recently installed Oracle Enterprise RDBMS 11.2.0.1.0 (64 bit) on my 64-bit Windows 7 machine. I'm now trying to get the built-in OWB 11.2 installation working as well. I managed to create a repository on my database using the Repository Assistant. But I can't seem to get OWB Design Center to run at all: it crashes out with a Windows message "application cannot be started" as soon as it tries to run owbclient.bat.
    I've tried starting the Control Center Service via the options on the Warehousebuilder/Admin menu, and this seems to work - at least the status comes back as "available" when I click the "Check status" button - but the Repository Browser doesn't work either: the URL looks OK but there's nothing there.
    As far as I can tell I've followed the installation/configuration steps OK, but I can't work out what else I need to install/do to get an OWB client talking to a local OWB installation on a local Oracle 11.2 database. It really shouldn't be this hard.
    Has anybody else encountered/resolved the same problems?
    Or should I just scrap my installation and start again from scratch?

    Thanks, Richard.
    I downloaded Oracle 11gR2 for 64-bit Windows only a couple of weeks ago, so I would have expected the built-in OWB client installation to be compatible with 64-bit Windows as well. Maybe that's just a crazy dream.
    In the end, I gave up on the built-in OWB. Instead, I trashed the existing OWB installation in the database completely, then installed the OWB stand-alone client in a separate home on the same machine instead, re-installing the OWB schemas etc and creating a fresh repository on the DB in the process. This seems to work so far - at least I can log in to the OWB Design Center client as my repository user, which is a major step forward.
    I dunno - I've been working with Oracle for 20 years, but their installation processes always seems to trip me up somewhere with missing components, incompatible elements, screwed up network addresses, and so on. Guess I'm just a slow learner.

  • Problem trying to use replaceAll with url string

    Can anyone give me some quick advice on how to replace part of a url? I'm trying replaceAll but I'm getting errors. My code is below. Thanks.
    String value = http://localhost:8280/portal/templates/page/library.jsp?foldId=libfold245696
    String hostName = "192.168.0.1";
    value = value.replaceAll("localhost",hostName);I want to replace "localhost" with the ip address.

    Here's the replaceAll version:
    package com.cellexchange.util;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    import java.util.Enumeration;
    import java.util.Properties;
    * Created on Nov 3, 2005
    public class UpdateExternalLinks {
        private String hostName;
        private String fileName = "/server/fvm/conf/ExternalLinks.properties";
        private static final String pattern = "localhost";
        private Properties properties;
        public UpdateExternalLinks(String hostName,String jBossHome){
            hostName = hostName;
            System.out.println("hostName: " + hostName);
            fileName = jBossHome + fileName;
            readPropertiesFile();
        public static void main(String[] args) {
            if(args.length == 0) {
                System.err.println("Usage: UpdateExternalLinks %HOST_NAME% %JBOSS_HOME%");
                System.exit(1);
            else {
                new UpdateExternalLinks(args[0],args[1]);
        public void readPropertiesFile() {
            try {
                properties = new Properties();
                properties.load(new FileInputStream(fileName));
                Enumeration propertyNames = properties.propertyNames();
                while(propertyNames.hasMoreElements()) {
                    String key = (String)propertyNames.nextElement();
                    String value = (String)properties.getProperty(key);
                    System.out.println("key: " + key);
                    System.out.println("value: " + value);
                    String newValue = value.replaceAll(pattern,hostName);
                    System.out.println("newValue: " + newValue);
                    //properties.setProperty(key,newValue);
               // writePropertiesFile(properties);
            } catch (IOException e) {
                System.err.println("Problem reading properties file");
        public void writePropertiesFile(Properties properties) {
            try {
                properties.store(new FileOutputStream(fileName), null);
            } catch (IOException e) {
                System.err.println("Problem writing properties file");
    }

  • Question on using of GROUP BY clause.

    Hi, can i do a GROUP BY without having any aggregate functions? Or is there any work around for that??
    I need to GROUP BY some selection but do not have any aggregate function in it.
    Thanks in advance. :)

    As already mentioned this can be achieved in SQL*Plus by using the break feature, but if you want it solely in SQL something like the following should do it...
    SQL> ed
    Wrote file afiedt.buf
      1  select decode(deptrow,1,deptno,null) as department, ename
      2  from (select deptno, row_number() over (partition by deptno order by ename) deptrow, ename
      3        from emp
      4       )
      5* order by deptno, ename
    SQL> /
    DEPARTMENT ENAME
            10 CLARK
               KING
               MILLER
            20 ADAMS
               FORD
               JONES
               SCOTT
               SMITH
               WILLIS
            30 ALLEN
               BLAKE
               JAMES
               MARTIN
               TURNER
               WARD
    15 rows selected.
    SQL>

  • Problems trying to use WRT320n as AP

    Hi!
    I've been messing with this for days, reading different forums with lots of tips as to how to do this.
    It's really frustrating that I can't get it to work, so i'm hoping someone will have the answer
    I have my main router, it's a modem/router setup (in one) with a LAN ip: 192.168.1.1 (standard).
    I have a ethernet cable from ethernet port 1 in my main router, and wired in ethernet port 1 on my WRT320n.
    I started off resetting my WRT320n for 30 seconds, and right after I switched the power off for another 30 seconds. (pulled the cord).
    Then I accessed the setup via my laptop which is wired.
    Started off setting up the wireless bit, same SSID, encryption and passphrase as my main router (wpa2/AES) Both mixed mode.
    Gave the router an ip: 192.168.1.2.
    Disabled DHCP.
    Basically what I want is, when the signal gets weak from my main router, the WRT320n takes over but uses the main router as DHCP.
    I can see that my device get's a LAN ip from my main router, but I have no flow what so ever.
    Can't ping anything LAN/WAN side, nothing.
    If I wire my laptop to my WRT320n router, I seem to have a connection, as I can ping both the router, and my main router but as soon as I go wireless, no flow.
    It's getting very frustrating and I honestly have no idea what to do now, so any help would be much appreciated
    Thanks in advance!

    Hi Krawlor, what you are trying to do is actually possible if you have a range extender instead of another router. Basically, the reason why you cannot have a seamless connection from the main router to the WRT320N is because even if they have the same SSID, they are being detected by your computer as two separate networks. What you can try to do is setup a different name instead for both networks and set your computer to connect automatically to both. That way, you can identify which one is which and the computer will just  be able to connect to the nearest network without you doing it manually.

  • User problem trying to use Control Copy Key

    Hi
    What must be checked for problems when a user try to copy ( ctrl + C ) then paste on Excel and nothing happen??
    I've checked Quick Cut and Paste ( ALT+F12 ), with a user works but not with other ( same PC)
    Thanks in advance.
    Moderator message - The forum is for ABAP questions - post locked
    Edited by: Rob Burbank on Apr 28, 2009 10:46 AM

    Is this an ABAP question??
    Rob

  • Problems trying to use simplified Chinese input

    I went to System Preferences > International > Input > Checked the box labeled "simplified chinese" and all the secondary boxes and yet when I try to switch to Chinese using the input menu the options for Chinese are faded and unclickable. Is there anything I should install?

    davisdartman wrote:
    when I try to switch to Chinese using the input menu the options for Chinese are faded and unclickable. Is there anything I should install?
    Does this happen in TextEdit?  If not, what apps?

  • How to use Group by clause in Infoset

    Hi,
    I have a infoset where I  am using two DSO .Now want to use the group by clause on basis of day, month, quarter .And also I want to use the left outer join .SO how will I do that ?
              Can somebody help me to to get these solved ?
    Regards
    Sunit

    Hi,
    for me it seems like Multiprovider is the one which we use in case when we want to go for group by option. This infoset is more kind of intersection operation.
    go through this link for more detailed info on Infoset
    http://help.sap.com/saphelp_nw2004s/helpdata/en/67/7e4b3eaf72561ee10000000a114084/content.htm
    Regards,
    rik

  • Can u write the following query without using group by clause

    select sp.sid, p.pid, p.name from product p, supp_prod sp
    where sp.pid= p.pid and
    sp.sid = ( select sid from supp_prod group by sid
    having count(*) =(select count(*) from product));
    thru this, we retrieving all the products delivered by the supplier.
    Can you write the following query without using the group by clause

      select sp.sid, p.pid, p.name
        from product p, supp_prod sp
       where sp.pid= p.pid the above query will still retrieve all the products supplied by the supplier. sub-query is not necessary.
    maybe if you can post some sample data and output will help us understand what you want to achieve.

  • 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

  • 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$_"}})

Maybe you are looking for

  • How to Connect Macbook to a TV

    Hi there Does anyone know how to connect a mac book to a TV with a Scart input? I was hoping to watch you tube on my Home TV - that kind of thing and I cant seem to find the correct lead, its probably very basic stuff - but I don't know! thanks in ad

  • Special (diacritical) characters in Spotlight

    When I have English set as "iPhone Language", and I type "tomas" in Spotlight search, I get search results including "Tomáš" (a name which includes special characters with diacritical marks). If I switch iPhone Language to Czech, I get no search resu

  • Function module for transaction lt06

    hi friends,           I want to know is there any function module for the transaction LT06 for 311 movement. points will be rewarded if helpfull. Message was edited by:         radhika kolluru

  • How to make a pattern in illustrator from a placed image ?

    how to make a pattern in illustrator from a placed image ?

  • Combining Billing

    <b>Is it possible to combine both Order related and Delivery related into one Billing.If yes how to do it.</b>