Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a wildcard be used in SQL with an Outer Join(+)?

Status
Not open for further replies.

Apollo6

Technical User
Jan 27, 2000
418
US
The following is an example of the code I am using:

UOM2."UOM_TYPE_CODE"(+) = '20'

The issue is that I can also have a value of '25'. How can I write a statement that will equal '20' Or '25' without returning records for both. SCR returns an error using the following code:

Example1: UOM2."UOM_TYPE_CODE"(+) = '20'Or '25'
Example2: UOM2."UOM_TYPE_CODE"(+) IN ('20','25')



 
A couple of things:
The error is not a SCR one, but a general SQL error. So the ANSI SQL forum would probably be a better spot for SQL errors. I making a point of mentioning this because people that use Crystal Reports (ie the people that read this forum) often use SQL a lot, and there is a forum that targets SQL questions.
This is not technically a "join", or even an "outer join".
It is typically called the "IN" operator, which checks to see if something is contained IN a set. So drop the (+),
Code:
UOM2."UOM_TYPE_CODE" IN ('20','25')
this is logically the same as
Code:
(UOM2."UOM_TYPE_CODE" = '20'
 OR
 UOM2."UOM_TYPE_CODE" = '25')
Malcolm
wynden@telus.net
November is "be kind to dogs and programmers" month. Or is that "dogs or programmers"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top