Hi.
I would like to retrieve all records from a table except these where
the (a, b) combination has one of a series of specific values. For
example, in MySQL I can given the table:
a b
1 2
1 3
3 4
Do:
SELECT a, b
FROM tbl
WHERE (a, b) != (1,2) AND (a, b) != (3,4)
And get result:
1 3
Whats the DB2 equivalent?
Thanks.
Morten 3 1085 us****@kikobu.com wrote:
>
Hi.
I would like to retrieve all records from a table except these where
the (a, b) combination has one of a series of specific values. For
example, in MySQL I can given the table:
a b
1 2
1 3
3 4
Do:
SELECT a, b
FROM tbl
WHERE (a, b) != (1,2) AND (a, b) != (3,4)
And get result:
1 3
Whats the DB2 equivalent?
DB2 only supports the equality comparison: http://publib.boulder.ibm.com/infoce...n/r0000747.htm
So you'll have to simply transform the above predicate.
NOT ( (a, b) = (1, 2) OR (a, b) = (3, 4) )
--
Knut Stolze
DB2 Information Integration Development
IBM Germany us****@kikobu.com wrote:
Hi.
I would like to retrieve all records from a table except these where
the (a, b) combination has one of a series of specific values. For
example, in MySQL I can given the table:
a b
1 2
1 3
3 4
Do:
SELECT a, b
FROM tbl
WHERE (a, b) != (1,2) AND (a, b) != (3,4)
And get result:
1 3
Whats the DB2 equivalent?
Thanks.
Morten
The DB2 equivalent, actually, the SQL equivalent, is to use IN.
In DB2 style (because of the VALUES clause) it becomes:
SELECT a, b
FROM tbl
WHERE (a, b) NOT IN (VALUES(1,2), (3,4))
B.
Knut Stolze wrote:
us****@kikobu.com wrote:
>Hi.
I would like to retrieve all records from a table except these where the (a, b) combination has one of a series of specific values. For example, in MySQL I can given the table:
a b 1 2 1 3 3 4
Do:
SELECT a, b FROM tbl WHERE (a, b) != (1,2) AND (a, b) != (3,4)
And get result:
1 3
Whats the DB2 equivalent?
DB2 only supports the equality comparison: http://publib.boulder.ibm.com/infoce...n/r0000747.htm
So you'll have to simply transform the above predicate.
NOT ( (a, b) = (1, 2) OR (a, b) = (3, 4) )
or use the [NOT] IN predicate
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
IOD Conference http://www.ibm.com/software/data/ond...ness/conf2006/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: steve |
last post by:
I am quite frustrated with php’s include, as I have spent a ton of
time on it already... anyone can tell me why it was designed like this
(or something I don’t get)?
The path in include is...
|
by: David Furey |
last post by:
Hi
I have an XML documnet and a XSLT document as shown below
THe XSLT document brings back a filtered docmument that has the VendorName
that starts with a particular sub-string
This works as...
|
by: Eric Osman |
last post by:
Hi,
I'm looking for a javascript function that will convert input such as this:
<CLUB Code="
into this:
<CLUB Code="
|
by: NecroJoe |
last post by:
I am using PHP to generate a little javascript for one of my pages. In
short it allows a user to select a value from a list and pop it into a form
field on a seperate page. This works well unless...
|
by: Mateusz Loskot |
last post by:
Hi,
I'd like to ask how XML parsers should handle attributes which consists
of " entity as value. I know XML allows to use both: single and
double quotes as attribute value terminator. That's...
| |
by: Arpi Jakab |
last post by:
I have a main project that depends on projects A and B. The main project's
additional include directories list is:
...\ProjectA\Dist\Include
...\ProjectB\Dist\Include
Each of the include...
|
by: martin |
last post by:
Hi,
I would be extremly grateful for some help on producing an xml fragemt.
The fragment that I wish to produce should look like this
<Addresses>
<Address>&qout;Somebody's Name"...
|
by: Ulysse |
last post by:
Hello,
I need to clean the string like this :
string =
"""
bonne mentalité mec!:) \n <br>bon pour
info moi je suis un serial posteur arceleur dictateur ^^*
\n ...
|
by: manchin2 |
last post by:
Hi,
Can anybody please provide the information about """ and its use, if possible please provide an example.
...
|
by: fran7 |
last post by:
Hi, from help in the javascript forum I found the error in some code but need help. This bit of code works perfectly, trouble is I am writing it to a javascript function so the height needs to be in...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |