Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help writing SQL Query

Author  Topic 

VENKATA NOOKALA
Starting Member

1 Post

Posted - 2011-05-11 : 08:27:30
desc employees
Name Null Type
-------------- -------- ------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)


Sample output

YR NUM_OF_HIRE NUM_OF_SA_REP NUM_OF_SH_CLERK
---- ----------- ---------------------- ----------------------
1987 2 0 0
1989 1 0 0
1990 1 0 0
1991 1 0 0
1993 1 0 0
1994 7 0 0
1995 4 0 0
1996 10 4 2
1997 28 8 4
1998 23 7 7
1999 18 5 5
2000 11 6 2

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-05-11 : 08:33:29
Read about Cross-tab reports in Help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-05-11 : 08:35:24
Also, this is a forum for Microsoft SQL Server. You may be better served elsewhere.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -