how convert row in column

All the discussion which is not possible in the above forums should be posted here.
Post Reply
mfa786
Posts: 51
Joined: Thu Jun 01, 2006 4:37 am
Location: Pakistan

how convert row in column

Post by mfa786 »

Hi master
sir this is my query and data
query ========
SELECT TO_CHAR(STUJOURNAL.stujdate, 'YYYY') AS YEAR,DEPARTMENT.NAME,SUBSTR(STUSECMTAMT.sem_code,5,4) AS SEMESTER,COUNT(STUSECMTAMT.STDCODE) AS TOTALSTUDENTS,SUM(STUSECMTAMT.totdebit) AS totdebit,SUM(STUSECMTAMT.totalcr) AS totalcr,SUM(STUJOURNAL.cre_bal) AS cre_bal,SUM(ROUND(NVL(STUJOURNAL.cre_bal/DECODE(STUSECMTAMT.totdebit/STUSECMTAMT.totalcr,0,NULL,STUSECMTAMT.totdebit/STUSECMTAMT.tota lcr),0),2)) AS reccrham,SUM(NVL(STUSECMTAMT.totdebit,0)-NVL(STUJOURNAL.cre_bal,0)) AS balance,SUM(ROUND(NVL((NVL(STUSECMTAMT.totdebit,0)-NVL(STUJOURNAL.cre_bal,0))/DECODE(STUSECMTAMT.totdebit/STUSECMTAMT.totalcr,0,NULL, STUSECMTAMT.totdebit/STUSECMTAMT.totalcr),0),2)) AS balcrham
FROM STUSECMTAMT,STUDEG,STUJOURNAL,DEPARTMENT,DEGREES
WHERE STUSECMTAMT.vhno=STUJOURNAL.ref_no
AND DEGREES.degree_code=STUDEG.degree_code
AND DEPARTMENT.DEPTNO=DEGREES.DEPTNO
AND SUBSTR(STUJOURNAL.stdjid,1,3)='SPY' AND
STUSECMTAMT.studegid=STUDEG.studegid GROUP BY TO_CHAR(STUJOURNAL.stujdate, 'YYYY'),DEPARTMENT.NAME,STUSECMTAMT.sem_code ORDER BY TO_CHAR(STUJOURNAL.stujdate, 'YYYY'),DEPARTMENT.NAME;


date ===============

year dept semester student
2002 Associate Degree Programme FALL 52
2002 Business Administration FALL 529
2002 Business Administration SPRI 35
2002 Computer Science Department FALL 381
2002 Computer Science Department SPRI 16
2002 Engineering Department FALL 17
2002 Engineering Department SPRI 2
2003 Associate Degree Programme FALL 1
2003 Associate Degree Programme FALL 5
2003 Associate Degree Programme SPRI 40
2003 Associate Degree Programme SUMM 6
2003 Business Administration FALL 1
2003 Business Administration FALL 596
2003 Business Administration SPRI 465
2003 Business Administration SPRI 257
2003 Business Administration SUMM 539
2003 Business Administration SUMM 1
2003 Computer Science Department FALL 1
2003 Computer Science Department FALL 403
2003 Computer Science Department SPRI 350
2003 Computer Science Department SPRI 156
2003 Computer Science Department SUMM 376
2003 Computer Science Department FALL 3
2003 Computer Science Department SPRI 3
2003 Engineering Department FALL 1
2003 Engineering Department FALL 17
2003 Engineering Department SPRI 15
2003 Engineering Department SPRI 11
2003 Engineering Department SUMM 14
2003 Institute Of Advertizing FALL 28
2003 Institute Of Advertizing SPRI 17
2003 Institute Of Advertizing FALL 1
2003 Institute Of Advertizing SUMM 2
2003 Institute Of Advertizing SUMM 1
2004 Associate Degree Programme FALL 3
2004 Associate Degree Programme SPRI 2
2004 Associate Degree Programme SUMM 2
2004 Business Administration FALL 2
2004 Business Administration FALL 524
2004 Business Administration SPRI 310
2004 Business Administration SPRI 258
2004 Business Administration SUMM 2
2004 Business Administration SUMM 542
2004 Business Administration SUMM 1
2004 Computer Science Department FALL 1
2004 Computer Science Department FALL 1
2004 Computer Science Department FALL 236
2004 Computer Science Department SPRI 197
2004 Computer Science Department SPRI 84
2004 Computer Science Department SUMM 1


sir i want semester in Separate colum such as FALL SPRI SUMM
as searate column or such as matrix wise

FALL SPRI SUMM
year depatemet student student student
2002 Associate Degree Programme 45 65 33
2002 Business Administration 23 65 57
2002 Business Administration 87 65 33
2002 Computer Science Department 5 65 567
2002 Computer Science Department 5 567 567
2002 Engineering Department 244 234 5
2002 Engineering Department 765 345 33
2003 Associate Degree Programme 34 456 33
2003 Business Administration 765 56 33
2003 Business Administration 45 65 33
2003 Computer Science Department 45 65 33
2003 Computer Science Department 45 65 33
2003 Engineering Department 45 65 33
2003 Engineering Department 45 65 33
2004 Associate Degree Programme 45 65 33
2004 Business Administration 45 65 33
2004 Business Administration 45 65 33
2004 Computer Science Department 45 65 33
2004 Computer Science Department 45 65 33
2004 Engineering Department 45 65 33
2004 Engineering Department 45 65 33


please give me idea

thank

aamir
najm
Posts: 74
Joined: Wed Apr 05, 2006 8:04 am
Location: Pakistan

Post by najm »

Which type of Help you need i m not under stand

Najm
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest