r3nder
asked on
I am trying to get distinct column value and count in db2
sIGPAD_PORT
80
80
3334
3334
10
II am trying to get the following from the table above
80 2
3334 2
10 1
.
80
80
3334
3334
10
II am trying to get the following from the table above
80 2
3334 2
10 1
.
[COUNT[DISTINCT ]]SIGPAD_PADPORT] asSIGPAD_PAD, ProjectId
FROM TBLUSERSESSION
WHERE EmpId IN
]
EmpId
FROM TBLUSERSESSION
GROUP BY SIGPAD_PADPORT
HAVING COUNT >=1
]
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I gget an error
SELECT SIGPAD_PORT, COUNT(SIGPAD_PORT) AScntr
FROM TBLUSERSESSION GROUPBY SIGPAD_PORT
unexpected token SIGPAD_PORT was found following LUSERSESSION GROUPBY - I thought maybebe a mispelled column name or incorrect case but both are right
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT SIGPAD_PORT,
COUNT(SIGPAD_PORT) AS cntr
FROM TBLUSERSESSION
GROUP BY SIGPAD_PORT
;
ASKER
I am unsure what you were saying ken but it was close to the solution - thank yoyu and to eveyone else as well
ASKER
Open in new window