HOW TO USE GROUP BY IN AZURE

hi,
I want to use aggregate functions (group and sum ) in azure mobile service?
e.g
my table is Expense and attribute id, name, amount, categories.
I want to group by categories and sum by amount attribute. 
thanks

Hi
You can write things like this:
 var sql = "SELECT MAX(Id) as Id, Uri FROM Channel " +
        "GROUP BY Uri HAVING COUNT(*) > 1";
Please mark post as answered if it helped!

Similar Messages

  • How to use GROUP BY  in ODI

    how to use GROUP BY in ODI tool

    Hi ,
    you can combine the insert stamt with the select ....so that in the target u will get a single line .....
    SQL> select * from prop_details;
    PROPERTY RELAVANTD NOTICES
    10100 25-JAN-09 30
    10100 03-JAN-09 30
    10100 02-DEC-08 20
    10100 01-DEC-08 10
    10100 31-DEC-08 20
    10101 10-JAN-09 10
    10101 20-JAN-07 15
    10101 30-DEC-08 45
    10101 20-FEB-08 35
    10101 31-JAN-09 25
    10 rows selected.
    SQL> select PROPERTY,max(RELAVANTDATE),SUM(NOTICES) from PROP_DETAILS GROUP BY P
    ROPERTY;
    PROPERTY MAX(RELAV SUM(NOTICES)
    10101 31-JAN-09 130
    10100 25-JAN-09 110
    SQL>

  • How to use "group" in iTunes?

    Hi...
    Need advice:
    Any ideas for how to use "Groups" under album "info" (cmd i)  
    (my iTunes is in Swedish, I am not sure what the English names are)
    This function has such a central position in "song info" but I cant understand how to use it...
    Best regards

    When I look in Edit > Preferences > General tab I find that the Libray name is still one of the old ones
    Then you are not opening a new library.
    If I rename to the library name it should be it still puts files in the wrong place.
    You should not rename the libraries.

  • How to use group function in insert or update

    Hai All
    How can we use group function in insert or update statement
    I am generating an attendance so i have different set of timing for example
    0800,1200,1230, 1700 and i need to insert into these data into table with min value to intime and max value to
    outtime and othere to inertval time in or out
    Pls tell me with some example
    For example
    For INSERT
    insert into T2 (barcode,empcode,intime,attend_date)
                   values(r2.cardn,r2.enpno,MIN(r2.ptime),r2.pdate);
    For UPDATE
    update dail_att set outtime= MAX(r2.ptime) where empcode=r2.enpno and barcode=r2.cardn and
    attend_date=r2.pdate;
    Here instead of where i need to use having so pls tell how to use
    Thanks & Regards
    Srikkanth.M

    Hai Man
    R2 is not a table name its a record
    Let me explain clearly
    I have to generate daily attendance for lot of employees So i have two table t1 and t2
    T1 consist of three column empno,date,time
    T2 consist of empno,name,date,intime,outtime,intrin,introut
    So now i need to give the T1 Min value Of time to T2 Intime and T1 Max value of Time to T2 Outtime fields so there so many records while i am using
    max(time) it gives the max value of all so i seperated by group function so now i have an error in subquery ie it is an single row subquery so i need to use multiple row subquery how i can use multiple row subquery in update statement
    Thanks In Advance
    Srikkanth.M

  • How to use Group Policy to remove the shutdown button on the logon screen

    Environment:  Shared use computers running Window 7 Professional and MS office Suite; Windows 2008 Standard server, Windows 7 EC Domain Policy and MS Office 2007 ADML Template downloaded from Microsoft. WIndows 7 Accounts OU.
    I am in the process of developing a shared use computer lockdown policy for several Windows 7 computers that will made available in my client's computer lab.  I need to use a group policy setting to remove the Shut Down button on
    the logon screen of the Windows 7 client computers.  I am editing the Windows 7 EC Domain Policy to user accounts in a Windows 7 Accounts OU that I created.  I am using the Group Policy editor in the Group Policy Management Console.  
    Please let me know the best practice for accomplishing this using Group Policy editor.
    Thanks.
    P.S. I tried a setting recommended in the following link in the Windows 7 EC Domain Policy which did not seem to work.
    http://www.windowsitpro.com/article/group-policy/can-i-use-group-policy-to-display-or-remove-the-shut-down-button-on-the-logon-screen-.aspx

    Hi Vernon,
    I tried the group policy you mentioned (Computer Configuration, Windows Settings, Security Settings, Local Policies, and select Security Options, "Shutdown: Allow system to be shut down without having to log on") and it worked on a Windows 7 client.
    Thus you may need to check if the group policy you created is actually applied to clients.
    A screenshot can be found here:
    http://cid-b7ed40feb32ba29f.office.live.com/self.aspx/.Public/desktop/Capture.JPG

  • How to use groups as invitees for an event in calendar.

    How can I use a group from contacts as an invitee in calendar?

    OOPS!!
    I posted my question in the wrong community

  • How to use group by in PL/SQL

    Can anyone give me a clue how to group rows using PL/SQL? I want to make a push button that groups a number of rows. When I run the form and push the button, I get the Oracle 01422 error. I am using one data block and, after pressing execute on the Oracle form in the web browser, I want to sort the rows using the group by clause as a pl sql trigger in a push button (with the WHEN BUTTON PRESSED trigger). I am new to Oracle Forms.

    I managed to use a cursor to access and display each row. I have to press the command button I created once for access of each row individually. I want to be able to push the button once, and populate each row with a record from my table. I am using the tabular format. Here is my code:
    DECLARE
         CURSOR email_message_cur
         IS
              SELECT sender, subject, body, date_time_sent
              FROM Email_Message
              ORDER BY sender;
    BEGIN
         OPEN email_message_cur;
         FETCH email_message_cur
         INTO :GROUP_EMAIL_MESSAGE.SENDER, :GROUP_EMAIL_MESSAGE.SUBJECT, :GROUP_EMAIL_MESSAGE.BODY, :GROUP_EMAIL_MESSAGE.DATE_TIME_SENT;
         WHILE email_message_cur%FOUND LOOP
              IF :GROUP_EMAIL_MESSAGE.SENDER IS NOT NULL THEN
                   CREATE_RECORD;
              END IF;
              FETCH email_message_cur INTO :GROUP_EMAIL_MESSAGE.SENDER, :GROUP_EMAIL_MESSAGE.SUBJECT, :GROUP_EMAIL_MESSAGE.BODY, :GROUP_EMAIL_MESSAGE.DATE_TIME_SENT;
         END LOOP;
         CLOSE email_message_cur;
    END;

  • 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

  • How to use Group in Query Print Layout

    Hi All,
    I have prepared a query for fetching all purchase details along with tax code, now I have ordered it on tax code and prepared a query Print Layout,
    Now within this Query Print Lay Out I want to group the tax code and want to add total of some columns at end of every tax code.
    Request to guide how to achieve this.
    Thanking you in advance,
    Samir Gandhi

    We need to use Sort and Group in combination.
    Select the repeatative area and in PLD menu select Sort, then select the column to be sort.
    then in Header / Footer of that respective repeatative area select the fields and put in the group no. in the General.

  • Crystal Reports 11 - How to use group in footer

    hello
    i have a recordset of multiple branches and that is grouped by customer already. a customer  can buy goods from multiple branches so it is summery of customers with their goods. and i need the summery of branches with detail like i have attached an image
    in this image it is the record of one customer with 4 goods which are from 2 branches and in footer it is summery of both branches. i'm having issue here while m showing summery of both branches.so how can i show this summary and it is not sure always that there is only 2 branches. it can be 1 or many.
    i'm using Crystal Report 11

    Hi Amit,
    Use a subreport to show the branch wise summary. Here's a bird's eye view of what you might have to do:
    1) Insert a Subreport pointing to the same table on the Group Header
    2) Right-click the Subreport > Change subreport links > Move the CustomerID or any field that uniquely identifies each customer to the Pane on the right > From the dropdown at the bottom right that reads 'Select data in Subreport based on field', choose the same field. This will link the customer fields from both the datasources.
    3) Inside the Subreport, create a group on the Branch Field and place all the required summary fields etc
    4) Suppress unwanted sections in the Subreport > Right-click the Subreport > Format Subreport > Uncheck 'Keep Object Together'.
    -Abhilash

  • How to use group by in tabular form

    Hi all
    i have a tabular form and i need to issue the goods not more then five and in 1 row i will issue only 1 qty
    so i use only five rows . but by mistake i will use 6 rows then it is wrong how to restrict it
    please guide
    Thanks and Regards
    vikas

    Hi Ammad Ahmed
    i have a order of dresses
    Dress name                        qty
    a                                       5
    b                                       8             
    c                                       55
    d                                       8
    now i issuing it for production
    and the issuing form is tabular and the way of issuing is like this
    dress name                          qty
    a                                           1
    a                                           1
    b                                           1
    a                                           1
    a                                           1
    a                                           1
    d                                           1
    d                                           1
    i need when i issue for production then i need to calculate the a,b and d are not more then the orderThanks and Regards
    Vikas Singhal
    Edited by: vikas singhal on Jan 14, 2011 3:46 PM

  • How to use group by in analytic function

    I need to write department which has minimum salary in one row. It must be with analytic function but i have problem with group by. I can not use min() without group by.
    select * from (select min(sal) min_salary, deptno, RANK() OVER (ORDER BY sal ASC, rownum ASC) RN from emp group by deptno) WHERE RN < 20 order by deptno;
    Edited by: senza on 6.11.2009 16:09

    different query, different results.
    LPALANI@l11gr2>select department_id, min(salary)
      2  from hr.employees
      3  group by department_id
      4  order by 2;
       DEPARTMENT_ID      MIN(SALARY)
                  50            2,100
                  20            2,100
                  30            2,500
                  60            4,200
                  10            4,400
                  80            6,100
                  40            6,500
                 100            6,900
                                7,000
                 110            8,300
                  70           10,000
                  90           17,000
    12 rows selected.
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- Always lists one department in a non-deterministic way
    LPALANI@l11gr2>select * from (
      2  select department_id, min(salary) min_salary
      3  from hr.employees
      4  group by department_id
      5  order by 2) where rownum = 1;
       DEPARTMENT_ID       MIN_SALARY
                  20            2,100
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- Out of the departments with the same least salary, returns the one with the least department number
    LPALANI@l11gr2>SELECT   MIN (department_id) KEEP (DENSE_RANK FIRST ORDER BY salary) AS dept_with_lowest_sal, min(salary) min_salary
      2  FROM        hr.employees;
    DEPT_WITH_LOWEST_SAL       MIN_SALARY
                      20            2,100
    LPALANI@l11gr2>
    LPALANI@l11gr2>-- This will list all the deparments with the minimum salary
    LPALANI@l11gr2>select department_id, min_salary
      2  from (select
      3  department_id,
      4  min(salary) min_salary,
      5  RANK() OVER (ORDER BY min(salary) ASC) RN
      6            from hr.employees
      7            group by department_id)
      8  WHERE rn=1;
       DEPARTMENT_ID       MIN_SALARY
                  20            2,100
                  50            2,100

  • How to use group by in query

    In this query  i want group by item description and quatity sum
    SELECT T0.[Dscription], T0.[Quantity], T0.[OpenSum],  T1.[DocNum], T2.[State] FROM DLN1 T0  INNER JOIN ODLN T1 ON T0.DocEntry = T1.DocEntry, CRD1 T2 WHERE T1.[CardCode] =  T2.[CardCode] AND  T1.[DocNum] Like '1_%%'

    Hi YYREDDY,
    When you use the GROUP clause, all the fields in the SELECT clause must either figure in the GROUP clause or be part of an aggregate function (AVG, SUM, COUNT, ...).
    SELECT
        T0.Dscription, SUM(T0.Quantity), SUM(T0.OpenSum)
    FROM
        DLN1 T0 INNER JOIN
        ODLN T1 ON T0.DocEntry = T1.DocEntry, CRD1 T2
    WHERE
        T1.CardCode = T2.CardCode AND T1.DocNum Like '1_%%'
    GROUP BY
        T0.Dscription
    Regards,
    Vítor Vieira

  • How to use GROUP BY in this Query

    The below query has TRUNC funtion and I don't want the NMR field to put in group by, but it should be in select.
    Please help
    SELECT H.SAM_ATTUID AS ATTUID1,
    B.AGENT_ID,
    TRUNC (NVL (FORC_ANNREV_PAID, CALC_ANNREV_PAID) / 12, 2) AS NMR,
    PRODUCT_GROUP
    FROM CNT380_TRAN_DATA A,
    CNT350_INWARD_DATA B,
    CNT330_CODE_VALUE C,
    CNT460_COMM_DATA D,
    CNT100_PROD_CUST E,
    CNT120_AGENT F,
    CNT127_AGENT_CAM G,
    CNT470_SAM H,
    CNT481_MSA_SAM K
    WHERE A.INWD_REF_NBR = B.INWD_REF_NBR
    AND A.INWD_REF_NBR = A.REF_NBR
    AND A.INWD_REF_NBR = D.INWD_REF_NBR
    AND A.CYCLE_DATE &gt;= '01-SEP-08'
    AND A.CYCLE_DATE &lt;= '30-SEP-08'
    AND B.SUBSID_CD = 'EAST'
    AND INWD_AGENT_CHAN = 'EALI'
    AND (NVL(FORC_ANNREV_PAID,CALC_ANNREV_PAID) &lt;&gt; 0
    OR NVL(FORC_ANNREV_RECOUP,CALC_ANNREV_RECOUP) 0)
    AND (B.PROD_CLASS_CD 'MSGWK' OR B.PROD_CLASS_CD IS NULL)
    AND RTRIM(B.ALTERNATE_PROD_CD) = RTRIM(C.CD_VALUE (+) )
    AND RTRIM(A.SPECIAL_PROCESS_IND) IN
    'ADD'
    ,'NEW'
    ,'WB'
    AND A.ACTIVITY_IND = 'I'
    AND B.AGENT_ID = G.AGENT_ID (+)
    AND B.SUBSID_CD = G.SUBSID_CD (+)
    AND A.SO_CMPL_DATE &gt;= G.START_EFF_DATE
    AND (A.SO_CMPL_DATE &lt;= G.END_EFF_DATE OR G.END_EFF_DATE IS NULL)
    AND (H.SAM_ATTUID &lt;&gt; 'DUMMY' AND H.SAM_ATTUID IS NOT NULL)
    AND H.SAM_CD=K.SAM_CD
    AND H.SUBSID_CD=K.SUBSID_CD
    group by
    b.AGENT_ID,
    PRODUCT_GROUP,
    SAM_ATTUID

    You have two choice
    1. Use an aggregate function like MIN, MAX etc on FORC_ANNREV_PAID, CALC_ANNREV_PAID
    2. Include FORC_ANNREV_PAID, CALC_ANNREV_PAID in the group by.
    Thanks,
    Karthick.

  • Webi  - How to use group by function and to make data distinct in that column

    Hi Everyone
    I'm a begginer in BO and i'm experiencing problems when trying to create a webi report that shows different courses, how many males and females in a course, their race and how many people attended each course. My challenge comes in wen i try to group by distinct courses:
    For Example
    Course name     Gender     Race         Attendees 
    BEXX11             Female     Coloured    2
    BEXX11             Male         African      1
    C3                    Male         Indian        2
    F3                    Female      White       1
    BEXX11            Female      Indian        3
    C3                   Female      Indian        4
    Course name     Gender     Race         Attendees
    BEXX11             Female     Coloured    2
                            Male         African       1
                            Female      Indian        3
    C3                    Male         Indian         2
                            Female     Indian         4
    F3                    Female      White       1
    Thanks in advance

    Hi Olebogeng Marumo,
    Apply the break on Course Name and then check the output.It will fulfill your requirement.
    Web Intelligence 4.0: Create breaks between groups of data
    Regards,
    Anish

Maybe you are looking for

  • How to use GX tags in a JSP?

    Hi, everybody! Our company have got a NAS 2.1 application (with AppLogic's and HTML templates) that it needs to be migrated to J2EE model. In this moment, we can't cover a complete migration from AppLogic to a J2EE, and furthermore, we have to mainta

  • Video download error =-.50 - how do I fix this

    I tried to download breaking bad and it stopped prematurely - download error =-.50. How do I fix this?

  • Retrofit issue

    Hi Experts, We have created TR in SE2:300 (SE2K900212) and after releasing it, we have got Transport Of Copies (SE2K900214). Now object which is relevant with Zpackage25 under this TR, we want that to move to SE2:200 client through automatic retrofit

  • I'm getting error

    Dear experts,                      When i run the sfp application, i'm getting this error, ADS: SOAP Runtime Exception: CSoapExceptionTransport :(100101) Message no. FPRUNX001 Thanks and Regards, Thiru. R

  • Cannot load Safari 6.1 on Macbook Pro

    Okay... so I have in my Applications folder on my Macbbok pro Safari 7.0.4 but I have OS X 10.8.5.  When I try to launch, it says the version of Safari can't be run.  So when I try to download Safari 6.1, the Safari app in my applications folder does