DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Nested Query in ORACLE

Threaded View

  1. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    Never go into a table more than once if you don't have to.

    Code:
    SELECT
       WAREHOUSE,
       COUNT(*)
          AS NUM_LINES, 
       SUM(
          CASE
             WHEN
                B.Q_OH   =  0
             THEN
                1
          END
          )
          AS ZERO_BAL
    FROM
       INVENTORY
    WHERE
       WAREHOUSE  =  :WAREHOUSE AND
       Q_RO       >  0 
    GROUP BY
       WAREHOUSE   ;
    - Chris
    Last edited by chrisrlong; 04-09-2003 at 06:27 PM.
    Christopher R. Long
    [email protected]
    But that's just my opinion. I could be wrong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width