Re: WebDB & PL/SQL

From: John Alexander <jalexander_at_summitsoftwaredesign.com>
Date: 2000/06/02
Message-ID: <Y%EZ4.1919$wT6.9471_at_typhoon.tampabay.rr.com>#1/1


[Quoted] You can use decode:

select dwprod_pymnt, sum(decode(dwcase,'Check',1,0)) Checksum, sum(decode(dwcase,'CreditCard',1,0)) CardSum from dwprod
group by dwprod_pymnt

jalexander_at_SummitSoftwareDesign.com

Moosie <mooseneck_at_my-deja.com> wrote in message news:8h6asb$a57$1_at_nnrp1.deja.com...
> Hello!
>
> I'm a newbie to WebDB and PL/SQL after using MSSQL for a few years. I've
> been asked to create a series of reports using WebDB connected to a
> database Oracle 8i. I don't have access to SQL-Plus or the Enterprise
> Mgr. on the Oracle Server. All I have to write reports is the WebDb.
> I'd like to write them using my own sql, but am having a problem with
> it.
>
> I want to create a report showing a count of two types of payments per
> quarter with information that's stored in one table, like--
>
> Check CreditCard
> 1st Qtr. 10 35
> 2nd Qtr. 12 29
>
> I've been able to create the first column, but can't do the second one.
>
> My sample script is:
>
> select dwprod_pymnt, count(dwprod_pymnt) AS Check
> from dwprod
> where dwcase_stat = 'Check'
> group by dwprod_pymnt
>
> I understand PL/SQL does not allow subqueries in the select statement
> (otherwise, I'd be done). Is a cursor or record the way to go here? I
> have a feeling I'm overcomplicating matters, but I can't think of
> another way to accomplish this.
>
> Thanks!
> Moosie
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Fri Jun 02 2000 - 00:00:00 CEST

Original text of this message