473,378 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

sub select

In DB2 8.2 on Linux is it possible to do sub select statements.
Statements like select col1, col2 from ( select col3, col4 from table
2 ) .....?
Also does DB2 8.2 have UNION, MINUS etc like Oracle?
Thanks,
Yasaswi
Nov 12 '05 #1
5 9710
Yasaswi Pulavarti wrote:
In DB2 8.2 on Linux is it possible to do sub select statements.
Statements like select col1, col2 from ( select col3, col4 from table
2 ) .....?
Also does DB2 8.2 have UNION, MINUS etc like Oracle?
Thanks,
Yasaswi

Yes to all.
Nov 12 '05 #2
Subselects do work in DB2 8.2, so do UNIONS.

I am unsure of MINUS.

Christos Kalantzis

Yasaswi Pulavarti wrote:
In DB2 8.2 on Linux is it possible to do sub select statements.
Statements like select col1, col2 from ( select col3, col4 from table
2 ) .....?
Also does DB2 8.2 have UNION, MINUS etc like Oracle?
Thanks,
Yasaswi

Nov 12 '05 #3
MINUS = EXCEPT I presume....
Nov 12 '05 #4
Hi Serge:
MINUS is Oracle returns rows selected by the first query, but not the
rows selected from second query. Having said that does the EXCEPT
operator in DB2 work like that?
Thanks,
Yasaswi

Serge Rielau <sr*****@ca.ibm.com> wrote in message news:<30*************@uni-berlin.de>...
MINUS = EXCEPT I presume....

Nov 12 '05 #5
Yasaswi Pulavarti wrote:
Hi Serge:
MINUS is Oracle returns rows selected by the first query, but not the
rows selected from second query. Having said that does the EXCEPT
operator in DB2 work like that?
Thanks,
Yasaswi

Serge Rielau <sr*****@ca.ibm.com> wrote in message news:<30*************@uni-berlin.de>...
MINUS = EXCEPT I presume....

I quote from the SQL Reference (fullselect):
EXCEPT or EXCEPT ALL
Derives a result table by combining two other result tables (R1 and
R2). If EXCEPT ALL is specified, the result consists of all rows that do
not have a corresponding row in R2, where duplicate rows are
significant. If EXCEPT is specified without the ALL option, the result
consists of all rows that are only in R1, with duplicate rows in the
result of this operation eliminated.

Cheers
Serge
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
4
by: Elroyskimms | last post by:
Using SQL 2000... tblCustomer: CustomerID int CompanyName varchar(20) HasRetailStores bit HasWholesaleStores bit HasOtherStores bit tblInvoiceMessages:
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
3
by: dumbledad | last post by:
Hi All, I'm confused by how to replace a SELECT statement in a SQL statement with a specific value. The table I'm working on is a list of words (a column called "word") with an index int...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
1
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
6
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.