If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > no support for selecting from unions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-03, 02:10
krajkumar6 krajkumar6 is offline
Registered User
 
Join Date: Sep 2003
Posts: 9
no support for selecting from unions

hi,

I use the db2 version V5R1M0 010525, DB2 UDB AS/400 .

I cannot run a do a select statement on any union SQL query.
Can someone tell me if this is a database limitation or if there is
any option that has to be set to enable this feature.

Also this db2 does not allow me to create views out of a
SQL query that uses a Union.

Could someone tell me how this can be overcome?

Thanks & Reg,
K Rajkumar
Reply With Quote
  #2 (permalink)  
Old 10-21-03, 02:20
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I don't know much about DB2 for AS/400, or even what the current release number is, but on DB2 for Linux, Unix, and Windows you can put a UNION ALL in a view since at least version 7 (the current version is 8), and maybe earlier.

But a UNION is not supported for views, only UNION ALL. Remember that a UNION tries to remove duplicate rows, and UNION ALL does not. Many times there are no duplicates to be removed and the UNION command is used inappropriately, when a UNION ALL would be better.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On