Maliki Hassani
asked on
ORACLE SQL: Add a count to query
Experts,
Can someone please help me out with my SQL statement? My SQL output is showing 4 different ticket ID's but I want it to use the count feature. Should show just the number 4.
Thanks!!
Using Oracle 10g
Can someone please help me out with my SQL statement? My SQL output is showing 4 different ticket ID's but I want it to use the count feature. Should show just the number 4.
Thanks!!
Using Oracle 10g
(SELECT DISTINCT (RELATED_TICKET_ID)
FROM ARADMIN.EMAIL_REPORTING
WHERE UDF_CONVERT_UNIX_DATETIME(CREATE_DATE, 'US/Eastern') >= (TRUNC(SYSDATE) - INTERVAL '1' DAY)
AND UDF_CONVERT_UNIX_DATETIME(CREATE_DATE, 'US/Eastern') < (TRUNC(SYSDATE) - INTERVAL '0' DAY)
AND MESSAGE_TYPE = 1
AND OWNER_GROUP = 'National-Carrier Operations'
AND RELATED_TICKET_ID LIKE 'MNT%'
OR UDF_CONVERT_UNIX_DATETIME(CREATE_DATE, 'US/Eastern') >= (TRUNC(SYSDATE) - INTERVAL '1' DAY)
AND UDF_CONVERT_UNIX_DATETIME(CREATE_DATE, 'US/Eastern') < (TRUNC(SYSDATE) - INTERVAL '0' DAY)
AND MESSAGE_TYPE = 0
AND OWNER_GROUP = 'National-Carrier Operations'
AND RELATED_TICKET_ID LIKE 'MNT%'
AND MAILBOX_NAME IS NOT NULL)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER