× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I hit enter too fast. Didn't notice the cut & paste hadn't worked.

I have a file that I need to prime a new field in.
If a record is found on another file with then the field should be set to Y otherwise set it to N.

I thought I might be able to use a CASE statement in SQL with the EXISTS predicate. I played with a SELECT statement in on-line SQL and can't get it to work. Here it is:

select
case
when exists(select polnoi from intpty
where polbrr=polbri and poltyr=poltyi and polnor=polnoi and pollor=polloi
and polrir=polrii) then 'Y'
else 'N'
end
from rskr05

the fields ending in i are from INTPTY and the fields ending in r are from RSK05.

Is it just a syntax problem?
I know there's two forms of the CASE statement and I'm thinking that the where clause needs some sort of a=B expression.

Is there another way of achieveing the same result.

Thanks and sorry about the empty email.
)

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.