Solved

not equal to symbol in db2

Posted on 2011-03-15
3
19,167 Views
Last Modified: 2014-09-22
We all know that <> is the not equal to symbol used for DB2 queries. I have seen that some of the legacy queries are having != symbol for not equal to. Can anyone confirm the same that we can use both conventions..?
0
Comment
Question by:jimsweb
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35137089
Hi,

you can use "!=" instead of "<>" if the used code page has the exclamation point as X'5A'.

This is what IBM have to say regarding your question:

The following forms of the comparison operators are also supported in basic and quantified predicates in coded pages where the exclamation point is X'5A': !=, !<, and !> . In addition, in code pages 437, 819, and 850, the forms ¬=, ¬<, and ¬> are supported. All these product-specific forms of the comparison operators are intended only to support existing SQL statements that use these operators and are not recommended for use when writing new SQL statements.

The above quote is from this document:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_basicpredicate.htm

HTH

wmp
0
 
LVL 8

Author Closing Comment

by:jimsweb
ID: 35140828
thanks!
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 40337792
or the "Not" prefix

FldA <> Fldb is the same as not FldA = Fldb
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now