User`s guide
SalesRep TableSalesRep TableManager TableManager Table
SalaryLast NameSalaryLast Name
$48,300.00Dodsworth$45,000.00Hellstern
23.5.10.14 Not Equal [!=] link
The result set from a Not Equal link includes all records in which the linked field value in the primary
table is not equal to the linked field value in the lookup table. This type of link can be used to find possible
combinations of items when a table is joined to itself (a self-join). For example, a company can have a
table listing all products they sell. When they decide to hold a sale where their customers buy one item
and get the second item half price, they may need a list of all possible two item combinations:
SELECT Product1.'Product Name',
Product2.'Product Name',
FROM 'Product' Product1
'Product' Product2
WHERE Product1.'Product Name' !=
Product2.'Product Name'
In this SQL statement, the Product table is opened twice. The first time, it is given the alias name
Product1. The second time, it is given the alias name Product2. Then the Product Name field is used
to link from the Product1 table to the Product2 table. This is the same table, but since it has been opened
twice using different aliases, Crystal Reports considers it two separate tables. A Not Equal link is used
to link the tables by the Product Name field. As a result, each product is paired with every other product
offered, but is not paired with itself:
Product2Product1
Product NameProduct Name
Xtreme Mtn LockXtreme Adult Helmet
InFlux Lycra GloveXtreme Adult Helmet
Roadster Micro Mtn SaddleXtreme Adult Helmet
Xtreme Adult HelmetXtreme Mtn Lock
2012-03-14543
Understanding Databases