TECH_NET
asked on
Help with Group By clauses
I have a sql statement as follows:
SELECT USER_REGISTRATION_ID,DEALS _NAME,VEND OR_NAME,PR OCESS_DATE FROM NOTIFYDEALS_LOGISTICS_VIEW GROUP BY USER_REGISTRATION_ID
I wish to get the following output.
Generate a list that is grouped by user_registeration and get the total count (based on the no of occurrance of the user_registration-id in the table), Also i wish to retrieve the remaider of the columns.
SELECT USER_REGISTRATION_ID,DEALS
I wish to get the following output.
Generate a list that is grouped by user_registeration and get the total count (based on the no of occurrance of the user_registration-id in the table), Also i wish to retrieve the remaider of the columns.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I have 3 records and all the record show up but i do not see the count showing up with the right value. Since all the 3 records are for the same USER, (ie USER_REGISTRATION_ID =1)
the resultant should be 3 records showing the count column value (ie idcnt) as 3.
the resultant should be 3 records showing the count column value (ie idcnt) as 3.
ASKER
SELECT USER_REGISTRATION_ID,Sum(U
but how do i get the remainder of the column and still show the aggregrate