[thelist] trouble w/ JOINs in an Oracle query

Jeremy Weiss eccentric.one at gmail.com
Thu Oct 1 11:16:58 CDT 2009


On Thu, Oct 1, 2009 at 10:12 AM, r937 <rudy at r937.com> wrote:
>
> what i mean is, you can't pull missing data from the data itself, without
> something to compare it to, to see which ones are missing

But.. I want the computer to do what I want it to do, not what I tell
it to do!!  :)

> you can create this table out of thin air, as it were, with the use of a
> numbers table in a derived query
>
> SELECT ...
>  FROM ( SELECT '2009-01-01' -- start date
>                + INTERVAL n MONTH   AS sale_date
>           FROM numbers
>          WHERE n BETWEEN 0 AND 11 -- for 1 year
>       ) sale_dates
> LEFT OUTER
>  JOIN ...
>

The derived query gives me an error, 'ORA-00923: FROM keyword not
found where expected'.

But you put me back on the right track. After seeing that I've been
looking at this incorrectly from the start and factoring in some other
issues I'm having with the end report I'm trying to build, I think I'm
going to step back and rethink this as there may be a better way to go
about this whole thing.

Thanks for setting me straight, Rudy.

-jeremy



More information about the thelist mailing list