Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Alternative to UNION
Al wrote:
> I'm trying to create a view in Oracle that will be accessed by a
> vendor application. Apparently the vendor app does something weird when
> it access a view that uses a UNION or UNION ALL statement. Is there an
> alternate method to UNION that can give the same result? The query
> below is a simplified version. Any help would be appreciated.
> -Thanks, Al Benvin
>
> CREATE OR REPLACE VIEW COMBO_V AS
> SELECT *
> FROM (SELECT ID
> FROM TABLE1)
> UNION ALL
> (SELECT ID
> FROM TABLE2) ;
Your inline view is unnecessary. However it will probably not be
ignored.
You could find out what 'something weird' is by using Explain plan.
I suspect the vendor's where clause is merged into the view, where it
should not be, or vice versa.
Depending on version, this can be turned off.
-- Sybrand Bakker Senior Oracle DBAReceived on Wed Jun 28 2006 - 09:58:59 CDT