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 -> Finding period NOT in a table

Finding period NOT in a table

From: Neff <fgpsmith_at_gmail.com>
Date: Tue, 21 Aug 2007 14:14:22 -0000
Message-ID: <1187705662.328566.212020@g4g2000hsf.googlegroups.com>


Is there an easy way to find which of a set of numbers isn't in a table? I'm trying to find financial periods that are missing from a set of data. I can do it if I have a table which just contains the valid period numbers 1- 12 in the following way:

SELECT
     period_num
FROM
     valid_periods
WHERE
      period_num NOT IN (SELECT DISTINCT data_period FROM data_table)

But is there a simple way to do it without the valid_periods table? Received on Tue Aug 21 2007 - 09:14:22 CDT

Original text of this message

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