One oracle note table allows Statistics of multiple fields (multiple count: count the total number of tickets in the WAIT_ORDER table, the total number of unprocessed tickets, the total number of completed tickets, and the total number of incomplete tickets. Table Structure: For the convenience of the example, the WAIT_ORDER table has only two fields, ID and STATUS, where STATUS indicates the ticket STATUS.
1 indicates not processed, 2 indicates completed, and 3 indicates the total number of incomplete tasks. SQL: [SQL] select count (B. ID) AS ticket COUNT (case when B. status IN ('1') THEN 'un _ demo' www.2cto.com END) Total number of unprocessed tickets, COUNT (case when B. status IN ('2') THEN 'had _ complete' END) Total number of tickets completed, COUNT (case when B. status = '3' then' un _ complete' END) Total number of unfinished tickets FROM WAIT_ORDER B
Result:
Author: baolong47