Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

distinct count on multiple columns

nohupDec 4 2012 — edited Dec 5 2012
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
"CORE 10.2.0.1.0 Production"
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
select  distinct USERID,REG_DATE,COUNT(*) CNT from REGISTRATION where TRUNC(REG_DATE)>TO_DATE('01-NOVEMBER-2012','DD-MONTH-YYYY')
and REG_ID not in (select REG_ID from REG_SEG_CAT) group by USERID,REG_DATE   
)
41	27-NOV-12	1
43	27-NOV-12	1
43	27-NOV-12	1
any idea how to show count=2 for userid 43

Edited by: 946207 on Dec 4, 2012 2:11 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2013
Added on Dec 4 2012
4 comments
809 views