PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

SQL TIP: FINDING TOTAL NO OF FEMALE AND MALE EMPLOYEES USING CASE

View previous topic View next topic Go down

SQL TIP: FINDING TOTAL NO OF FEMALE AND MALE EMPLOYEES USING CASE

Post  maran on Mon May 16, 2016 10:58 pm

SQL TIP: FINDING TOTAL NO OF FEMALE AND MALE EMPLOYEES USING CASE

EXAMPLE:
      SELECT COUNT(*), SUM(CASE SEX WHEN 'F' THEN 1 ELSE 0 END) ,
      SUM(CASE SEX WHEN 'M' THEN 1 ELSE 0 END) FROM EMPLOYEE
avatar
maran
Admin

Posts : 442
Join date : 2009-07-24

View user profile http://pmsinformationsystem.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum