Getting an error not a groupby expression

Hi Here is my select statement, I want to select values from different tables before using Decode it is working fine when I included Decode I am getting an Error "Not a group by Expression". I have verified all the columns I have included in group by clause, please help on this
select EMPM.EMPNO, EMPM.FIRSTNAME||' '||EMPM.SURNAME as EMPNAME, OTBM.EMPNO, OTBM.CEILINGCODE,
TO_CHAR(OTBM.STARTDATE,'DD-MM-YYYY') as STARTDATE,OTCM.OTCEILINGHRS,
max( DECODE( OTBD.WEEKDAY, 1, OTBD.DAYCEILINGHRS, null ) ) AS DAY1_HRS,
max( DECODE( OTBD.WEEKDAY, 2, OTBD.DAYCEILINGHRS, null ) ) AS DAY2_HRS,
max( DECODE( OTBD.WEEKDAY, 3, OTBD.DAYCEILINGHRS, null ) ) AS DAY3_HRS,
max( DECODE( OTBD.WEEKDAY, 4, OTBD.DAYCEILINGHRS, null ) ) AS DAY4_HRS,
max( DECODE( OTBD.WEEKDAY, 5, OTBD.DAYCEILINGHRS, null ) ) AS DAY5_HRS,
max( DECODE( OTBD.WEEKDAY, 6, OTBD.DAYCEILINGHRS, null ) ) as DAY6_HRS,
max( DECODE( OTBD.WEEKDAY, 7, OTBD.DAYCEILINGHRS, null ) ) AS DAY7_HRS,
ADDHOURS_FUN(OTCM.DAY6_HRS,OTCM.DAY7_HRS) as TOTHRS,SEM.SECTIONNAME,CGM.CATEGORYNAME,ORGM.ORGANIZATIONID,CCM.COSTCENTREID
,SPA.SHIFTPATTERNCODE,SEM.SECTIONDESCRIPTION,SEM.SECTIONID,DNM.DESIGNATIONNAME
from EMPLOYEEMASTER EMPM,OTBOOKINGMASTER OTBM,OTCEILINGMASTER OTCM,OTBOOKINGDETAILS OTBD,
SECTIONMASTER SEM,CATEGORYMASTER CGM,ORGANIZATIONMASTER ORGM,COSTCENTREMASTER CCM,
SHIFTPATTERNALLOTMENT SPA,DESIGNATIONMASTER DNM
where OTBM.EMPNO=P_EMPNO and OTBM.STARTDATE=P_STARTDATE
and OTBM.CEILINGCODE = OTCM.CEILINGCODE
AND OTBD.OTBOOKINGID=OTBM.OTBOOKINGID
AND EMPM.EMPNO = OTBM.EMPNO
AND SPA.EMPNO = EMPM.EMPNO
AND SPA.STARTDATE = P_STARTDATE
and SEM.SECTIONID=EMPM.SECTIONID
and EMPM.CATEGORYID=CGM.CATEGORYID
AND EMPM.DESIGNATIONID=DNM.DESIGNATIONID
AND DNM.CATEGORYID=EMPM.CATEGORYID
AND EMPM.CATEGORYID != '4'
and CCM.COSTCENTREID=SEM.COSTCENTREID
and ORGM.ORGANIZATIONID=CCM.ORGANIZATIONID
group by EMPM.EMPNO,EMPM.FIRSTNAME,EMPM.SURNAME,OTBM.EMPNO,OTBM.CEILINGCODE,
OTBM.STARTDATE,OTCM.OTCEILINGHRS,OTBD.WEEKDAY,OTBD.DAYCEILINGHRS,
SEM.SECTIONNAME,CGM.CATEGORYNAME,ORGM.ORGANIZATIONID,CCM.COSTCENTREID,
SPA.SHIFTPATTERNCODE,SEM.SECTIONDESCRIPTION,SEM.SECTIONID,DNM.DESIGNATIONNAME
ORDER BY TO_NUMBER(EMPM.EMPNO);

ChakravarthyDBA wrote:
before using Decode it is working fine when I included Decode I am getting an Error "Not a group by Expression". I have verified all the columns I have included in group by clause, pleaseIt looks more like you added this,
         addhours_fun ( otcm.day6_hrs, otcm.day7_hrs) AS tothrs,Let me hep you format your code:
select   empm.empno,
         empm.firstname || ' ' || empm.surname as empname,
         otbm.empno,
         otbm.ceilingcode,
         to_char ( otbm.startdate, 'DD-MM-YYYY') as startdate,
         otcm.otceilinghrs,
         max (decode (otbd.weekday, 1, otbd.dayceilinghrs, null)) as day1_hrs,
         max (decode (otbd.weekday, 2, otbd.dayceilinghrs, null)) as day2_hrs,
         max (decode (otbd.weekday, 3, otbd.dayceilinghrs, null)) as day3_hrs,
         max (decode (otbd.weekday, 4, otbd.dayceilinghrs, null)) as day4_hrs,
         max (decode (otbd.weekday, 5, otbd.dayceilinghrs, null)) as day5_hrs,
         max (decode (otbd.weekday, 6, otbd.dayceilinghrs, null)) as day6_hrs,
         max (decode (otbd.weekday, 7, otbd.dayceilinghrs, null)) as day7_hrs,
         addhours_fun ( otcm.day6_hrs, otcm.day7_hrs) as tothrs,
         sem.sectionname,
         cgm.categoryname,
         orgm.organizationid,
         ccm.costcentreid,
         spa.shiftpatterncode,
         sem.sectiondescription,
         sem.sectionid,
         dnm.designationname
from     employeemaster empm,
         otbookingmaster otbm,
         otceilingmaster otcm,
         otbookingdetails otbd,
         sectionmaster sem,
         categorymaster cgm,
         organizationmaster orgm,
         costcentremaster ccm,
         shiftpatternallotment spa,
         designationmaster dnm
where        otbm.empno = p_empno
         and otbm.startdate = p_startdate
         and otbm.ceilingcode = otcm.ceilingcode
         and otbd.otbookingid = otbm.otbookingid
         and empm.empno = otbm.empno
         and spa.empno = empm.empno
         and spa.startdate = p_startdate
         and sem.sectionid = empm.sectionid
         and empm.categoryid = cgm.categoryid
         and empm.designationid = dnm.designationid
         and dnm.categoryid = empm.categoryid
         and empm.categoryid != '4'
         and ccm.costcentreid = sem.costcentreid
         and orgm.organizationid = ccm.organizationid
group by empm.empno,
         empm.firstname,
         empm.surname,
         otbm.empno,
         otbm.ceilingcode,
         otbm.startdate,
         otcm.otceilinghrs,
         otbd.weekday,
         otbd.dayceilinghrs,
         sem.sectionname,
         cgm.categoryname,
         orgm.organizationid,
         ccm.costcentreid,
         spa.shiftpatterncode,
         sem.sectiondescription,
         sem.sectionid,
         dnm.designationname
order by to_number (empm.empno);Regards
Peter

Similar Messages

  • I´m getting these error ORA-00936:missing expression runnig a Task on Info

    I´m getting these error ORA-00936: missing expression, when running the SDE_ORA_Reverse_GLJournals task.
    I´m setting the variables $$FILTER_BY_LEDGER_ID, $$FILTER_BY_LEDGER_TYPE, $$LEDGER_ID_LIST and $$LEDGER_TYPE_LIST in the DAC correctly. I see the values asigned to those variables in the parameters file( SDE_ORA_Reverse_GLJournals.txt)
    But when the task is executing, those values comes empty. Does someone have encountered with the same mistake?
    Thanks in advanced.

    Hi,
    Im finding a similar issue but with task SDE_ORA_GLJournals,
    the code is :
    AND DECODE(, 'Y', GL.LEDGER_ID, 1) IN ()
    AND DECODE(, 'Y', GL.LEDGER_CATEGORY_CODE, 'NONE') IN ()]
    the parameters are also fine in the parameters file.
    Has anyone found a solution or an explanation for this?
    Thanks a lot, regards
    Nestor

  • I'm getting an error: not enough space to backup on icloud, but I do have enough storage available. Can you advise?

    I'm getting an error: not enough space to backup on icloud, but I do have enough storage available. Can you advise?

    There shouldn't be any fee involved.  Call the Apple online store for your country (1-800-MY-APPLE in the U.S. and Canada) and request a refund.
    If the download is stuck, you can download in iTunes on your computer, then sync it to your iPad once your free up some space.  This explains how to download your previous purchases to your computer: http://support.apple.com/kb/ht2519.

  • I am using DVD Studio Pro to create a DVD. The assets total about 2.4GBs using a 4.7 GB disc I still get the error " not enough space on disc" Does anyone know why?

    I am using DVD Studio Pro to create a DVD. The assets total about 2.4GBs using a 4.7 GB disc I still get the error " not enough space on disc" Does anyone know why?

    Start by using this to make sure your assets really fit on the disk:
    http://www.kenstone.net/fcp_homepage/bit_budget.html

  • Architecture: Mware View Horizon 5.3 with SVGA K1 GRID, W7 64 bit 4GB RAM and 3 CPU and 512MB VRAM  Issue 1: Photoshop setting is gpu[0].MemoryMB=128. Why ? It wolud be 512MB. Issue 2: Sometimes, We get the error not enough Vram. Why don't Photoshop  use

    Architecture: Mware View Horizon 5.3 with SVGA K1 GRID, W7 64 bit 4GB RAM and 3 CPU and 512MB VRAM
    Issue 1: Photoshop setting is gpu[0].MemoryMB=128. Why ? It wolud be 512MB.
    Issue 2: Sometimes, We get the error not enough Vram. Why don't Photoshop  use all 512MB vRAM?@

    Photoshop can only see what your video card driver reports.
    You might want to update your video card driver from the GPU maker's website.

  • Migrating from Sql server get SQL Error: ORA-00936: missing expression

    All,
    I'm migrating from Sql Server to oracle 10g and I'm getting a
    "SQL Error: ORA-00936: missing expression" error
    when the following create table statement is executed. It appears 10g does not like the CREATE DEFAULT xxxx as xxx syntax. Any ideas??
    CREATE TABLE EnvCapitalOtherCostAtom (
    EnvID CHAR(36) NOT NULL,
    CapitalID CHAR(36) NOT NULL,
    Seq FLOAT DEFAULT
    CREATE DEFAULT D_Set_To_Zero
         AS 0
    NOT NULL,
    AtomID CHAR(36) DEFAULT
    CREATE DEFAULT D_NewGUID
         AS newid
    NOT NULL,
    AtomName VARCHAR2(100) NOT NULL,
    AtomName_dqa NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_DQA_Dflt
         AS 10
    NOT NULL,
    CreatedOnTimeStamp TIMESTAMP(6) NOT NULL,
    LastEditedOnTimeStamp TIMESTAMP(6) NOT NULL,
    TFDubh_dqa NUMBER(5,0),
    record_flags NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_Record_Flags
         AS 0
    NOT NULL,
    record_dqa NUMBER(5,0) DEFAULT
    CREATE DEFAULT D_Record_DQA
         AS 30
    NOT NULL
    );

    Hi Chris,
    not sure SQL Server accepts the syntax you provided either. Even more I have checked MSDN(http://msdn2.microsoft.com/en-us/library/ms173565.aspx) and they recommend:
    Avoid using CREATE DEFAULT in new development work, and plan to modify applications that currently use it. Instead, use default definitions created using the DEFAULT keyword of ALTER TABLE or CREATE TABLE. CREATE DEFAULT will be removed in a future version of Microsoft SQL Server.
    In Oracle you should do the same either use DEFAULT in CREATE TABLE statement or in ALTER TABLE, have a look at http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_constraints.htm#sthref626 for more details.
    The proper Oracle syntax for your DDL should be something like:
    CREATE TABLE EnvCapitalOtherCostAtom (
    EnvID CHAR(36) NOT NULL,
    CapitalID CHAR(36) NOT NULL,
    Seq FLOAT DEFAULT 0 NOT NULL,
    AtomID CHAR(36) DEFAULT SYS_GUID() NOT NULL,
    AtomName VARCHAR2(100) NOT NULL,
    AtomName_dqa NUMBER(5,0) DEFAULT 10 NOT NULL,
    CreatedOnTimeStamp TIMESTAMP(6) NOT NULL,
    LastEditedOnTimeStamp TIMESTAMP(6) NOT NULL,
    TFDubh_dqa NUMBER(5,0),
    record_flags NUMBER(5,0) DEFAULT 0 NOT NULL,
    record_dqa NUMBER(5,0) DEFAULT 30 NOT NULL
    );

  • HT1911 When I click on my iTunes I get an error note "This copy of iTunes is corrupted or is not installed correctly.  This is after just loading the newest version tonight??

    I just donloaded the newest verion of iTunes.  Now when I click on my short cut I get an error message "This copy of iTunes is corrupted or is not installed correctly.  Please reinstalliTunes.
    How do I get back into my account and retrieve my itune library?

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • How do I get FB3 to not floor my expression numbers?

    I am using Flex Builder 3 and doing custom expressions in the
    debug view :
    (serverTime - offsetTime) / (1000 * 60*60*24) = 4
    WHen I work this out in the calculator it it 4.99999167
    How do I get FB3 to not floor my numbers?

    This works. Am I missing something?

  • I am unable to download itunes. i keep getting an error, not susfficient priviledge

    i have a new laptop, windows 8.

    Hello Karen,
    Thanks for participating in the Apple Support Communities.
    It seems like you're trying to install iTunes on your new Windows laptop, but you get an error about "insufficient privileges." Try the following tips to troubleshoot this situation:
    Make sure that you're logged in to your computer as an administrator.
    If you're not sure if you have an administrator account, read Windows 7: How do I log on as an administrator? You can also refer to your computer's help system, contact your IT department, or visit support.microsoft.com for assistance.
    Install the latest Microsoft Windows updates.
    To download the latest updates, visit the Microsoft Windows Update website. iTunes for Windows requires Windows XP, Windows Vista, Windows 7, or Windows 8, with the latest Service Pack installed. If you can’t install the updates, refer to your computer's help system, contact your IT department, or visit support.microsoft.com for assistance.
    Visit the iTunes download page. Click Download Now to download the iTunes installer. When prompted, click Save (instead of Run).
    Right click on iTunesSetup or iTunes64Setup (the installer you downloaded in step 3).
    If you have Windows Vista, Windows 7, and Windows 8: Choose "Run as administrator."
    If you have Windows XP: Choose Open.
    If you've previously installed iTunes, the installer will prompt you to repair the software.
    After the repair is complete, restart your computer and try launching iTunes.
    From:
    If you can't install or update iTunes for Windows - Apple Support
    All the best,
    Jeremy

  • I'm trying to install PSE but I get a error : not a genuine copy. how can I Solve it and complete the installation?

    This is a purchased copy but I get an error saying the copy is not and the installation is terminated.
    Please help...

    download a valid copy and activate with your serial number.
    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • I need to sudo cs delete an encrypted hard drive but get an error "Not a valid CoreStorage Logical Volume Group UUID"

    Ok so I encrypted an internal HDD with DOE compliant encryption, and forgot the password. I am not using a typical mac bootloader so apple C when its booting will not work to delete it before its mounted. I have to do it through the terminal. The drive I want to delete is HDD2. Here is the screen capture of running diskutil cs list in terminal.
    Then I disconnected everything to avoid problems, leaving my encrypted HDD only, copied the UUID, it's in this format:
    diskutil cs delete XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    But I am unsure which group or physical UUID I need to use, there are three associated with HDD2, logical volume group, physical volume and logical volume family. I thought before pressing enter I better ask first ... as I tried it on the physical volume first and I got the error in the title so dont want to start guessing what do to.
    Thanks                       

    Is it not good form for members to advise about using the console? Surely some members are knowledgeable enough to tell me the answer to this .... I know it's easy to bork your system up totally with the console but I'm desparate, my main drive has 1GB free!

  • Get "client-error-not-possible" when printing to Adobe pdf 8.0

    Problem suddenly appeared in Adobe pdf 7.0 when I upgraded to the MacBook Pro from an older ibook. I thought that there was a compatibility problem with 10.5. However, now I have done a new install of Adobe Acrobat Pro 8.0 and the problem still exists.
    The "printer" seems to add normally, but as soon as I print, the printer stops. If I resume it and the job in the queue, the error message appears.
    There must be some setting that I'm missing.

    Hello lisagig and welcome to Apple Discussions.
    I would be inclined to run a repair disk permissions first and if that doesn't help then I would reset your printing system. Note that this will remove all of your current printer queues so if you have a number of network printers in the list it would be handy to make a note of their network queue, which you will see via the Print & Fax > Options & Supplies > General pane shown as URL.
    To add the PDF printer queue back, you will need to make the Advanced icon appear in the Add Printer pane. To do this, open Print & Fax and click to Add a printer. Control Click on the current toolbar (next to More Printers will be fine) and select Customize Toolbar. Drag the Advanced icon to the toolbar. Now click the Advanced icon. After a few seconds this pane will become active so you can select the Adobe PDF 8.0 (pdf) in the Type column. Every other column will autofill so leave them as they are except for the Print Using menu, where you will have to open, click 'Select a driver to use' and then type Adobe in the search window. This should show the 'Adobe PDF 3016.102'. Select this and click Add to complete. Now try printing with this new Adobe printer to see if the error has stopped.
    Pahu

  • Have a mbpro and trying to burn a dvd in its player but keep getting this error note:, have a mbpro and trying to burn a dvd in its player but keep getting this error note:

    The drive reported an error:
    Sense Key = MEDIUM ERROR
    Sense Code = 0x73, 0x03
    Anyone knows what does it mean? Why I can't burn a dvd on the computer's player? THanks

    I am using MPEG2 not AVC.
    I tried recreating everything couple of times starting from exporting form premiere, but no luck. Then I decided not to re start from premiere but just try a new encore project. I imported Premiere encoded M2v video and WAV audio in Encore. This way I lost the chapter markers created in premiere, so I recreated chapters in encore, and created menu. And started to build the DVD. This time my file size shows at 22.4 GB (and not 267) - which is great. But it did not succeed in building the DVD - got error 14 - file format error.
    When I created new Encore project, I chose 20 mbps data and edited encoding settings to 29.97 (as by default Encore was changing it to 23. something frames) - other settings were Min data rate at 7 (it does not let me increase that), taget rate 22 and max 30.
    Any suggestions to resolve error 14?
    Thanks.
    RV

  • 6945 Phones get JTAPI ERROR, not 6941

    Hi, I have the same config if I compare a 6941 vs 6945 but the agent can't login with CAD if they have a 6945.
    Anyone ?                  

    Hi Philippe,
    Could you please attach the exact error screenshot of this CAD. Along with the CAD logs (C:\Program Files\Cisco\Desktop\log)
    Thanks,
    Anand

  • In Expression Web 4 get this error: "Firefox doesn't know how to open this address, because the protocol (c) isn't associated with any program."

    This is a recent problem. Added CSS3Draft and HTML 4.01 Transitional, from the original CSS2.1 and HTML 1.0 Transitional. Since then, can still view my Expression Web 4 website in IE9, but Firefox no longer will view site. Instead I get the error mentioned above. Expression Forum site, and CoffeeCup forum site both say this is problem with Firefox, that others have also been having. They say, Firefox can't see the site on my drive, since the address is not same as it would be if site was up on a server. Can you help?

    That you happen if you try to open a link to a local file on the computer with c:\xxx or c:/xxx<br />
    Such links should be opened with the file: protocol: file:///c:/
    *http://kb.mozillazine.org/Links_to_local_pages_do_not_work

Maybe you are looking for

  • Power mac G5 2004 won't power on

    Hello all, my Power mac G5 June 2004, won't power on at all. I've changed the logic board, power supply, dual processors, front panel board, and front panel board cable. Still getting the same results. The only thing I could think of next is the powe

  • Should I use a separate JAVA instance for ADS

    My customer has Enterprise portal and R/3 installed already.  Now they want ADS installed.  Would it be best to install a new JAVA instance for ADS or should I use the existing JAVA instance that is installed for the portal?  I think the customer is

  • Problem with copy of the object

    Hi, trying to copy (clone) my object: var a:TestObj = new TestObj() var a2:TestObj = ObjectUtil.copy( a ) as TestObj; but i recieve nothing. So the ObjectUtil.copy can return me only the Object type, but i want a concrete type!!! Is it possible?

  • Server Hardening Issues in Distributed Installation on Windows

    Hello, We are installing SAP CE 7.1 in a Distributed Installation on Windows. SCS and App Server on one HOST and DB (Oracle) on another host. There is a firewall between DMZ and App Server. There is a second firewall between App and DB Server Our Net

  • Packaging an In Design file

    I am trying to package an In Design file but keep getting the message 'Cannot copy necessary linked file(s).  Any suggestions for a fix or an easy way around this please?