Solved

not equal to symbol in db2

Posted on 2011-03-15
3
22,010 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 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