Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Crosstab Query

Crosstab Query

From: <speng_at_ncs.com.sg>
Date: Mon, 28 Sep 1998 07:49:17 GMT
Message-ID: <6unf1s$ktc$1@nnrp1.dejanews.com>


I have a table with the columns as shown below:

<My_table>
unemp varchar2(1)
isdereg varchar2(1)
exp date
rereg_dte date
renel_dte date

How to i select a crosstab query that will calculate total no. in NewReg where unemp='0' and so on.

unemp NewReg Re_Reg Renew_Reg
0 total total total
1
2
3
4
5

where the conditon for:
NewReg => isdereg ='N' and exp > sysdate

           rereg_dte and renl_dte is null

Re_reg => isdereg='N' and exp > sysdate

          rereg_dte is not null

Renew_reg => isdereg='N' and exp > sysdate

             renl_dte is not null

--
Sok Peng

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Mon Sep 28 1998 - 02:49:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US