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

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

Join the forum, it's quick and easy

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

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

Go down

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

Post  maran 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
maran
maran
Admin

Posts : 442
Join date : 2009-07-24

https://pmsinformationsystem.forumotion.net

Back to top Go down

Back to top

- Similar topics

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