Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

group problem

Status
Not open for further replies.

Raul2005

Programmer
Sep 23, 2005
44
US
Select distinct
trunc(sessions.starttime) as date,
comp.name,
comp.HC,
sessions.ctype,
count (sessions.userid)
from
S_USERSESSION sessions,
S_USER users,
S_COMPANY comp
where
sessions.userid = users.userid and
users.companyid = comp.companyid and
sessions.starttime > trunc(sysdate) - 10 AND
sessions.passwordverified='Y'
group by
date,clienttype,sessions.userid,comp.name,comp.holdingcompanyid


StartTime company HC CTYPE COUNT
2005-11-29 A 107 0 1
2005-11-29 A 107 0 1
2005-11-29 D 107 0 1

2005-11-29 c null 0 1
2005-11-29 c null 0 1


2005-8-29 B null 0 1
2005-8-29 B null 0 1
2005-8-29 B null 0 1

I would like to get this result
dealer has HC field no equal Null.


Results

StartTime Cliente Dealer COUNT
2005-11-29 3 2 5
2005-8-29 3 0 3

Thanks for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top