HP3000-L Archives

June 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Peter Chong <[log in to unmask]>
Reply To:
Peter Chong <[log in to unmask]>
Date:
Fri, 7 Jun 2002 12:02:06 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (48 lines)
Hi, Kevin
Can you make count sub select statement to view
The view is select by year & account
decode statement for counting will be batter

Sr. ERP Analyst, Multi Platforms
"Mullins, Kevin" <[log in to unmask]> wrote in message news:<[log in to unmask]>...
> Would appreciate any help that this great list can offer...please note the
> following SQL code
>
> select
>     profit_centers.pc_code,
>     accounts.account_number,
>     accounts.account_name,
>     accounts.insurance_premium_vanline,
>     y2001.y2001_count,
>     y2002.y2002_count
> from accounts,
>      profit_centers,
>      (select count(mode_details.mode_details_number) y2001_count
>      from mode_details, accounts
>      where accounts.account_number = mode_details.bill_to_number
>        and mode_details.date_cancelled is null
>        and mode_details.mode_number = 4
>        and trunc(mode_details.date_booked) between '01-JAN-2001' and
> '31-DEC-2001') Y2001,
>      (select count(mode_details.mode_details_number) y2002_count
>      from mode_details
>      where mode_details.date_cancelled is null
>        and mode_details.mode_number = 4
>        and trunc(mode_details.date_booked) between '01-JAN-2002' and
> '31-DEC-2002') Y2002
>
> Now the question - how can I get the queries in the FROM clause to only
> retrieve the count based on the account number in the outermost main
> query....Oracle is the database being queried in this instance.
>
> TIA for any help anyone can offer....
>
> Regards,
> Kevin
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2