ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

different way perhaps

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • different way perhaps

    Code:
    select Max(POFound) into :RecordFound
              From (
                      select Count(Ponumb) PoFound
                      from pomhst
                      Where Char(Ponumb) = :Mix_Field6
                      union
                      select Count(Ponumb) POFound
                      from pomhdr
                      Where Char(Ponumb) = :Mix_Field6 ) POTest
    So a mix_field6 might be in one of the 2 files. i just want to know if it is found at all.

    This works and is fast. i am just wondering about a different method.

    Thanks.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

  • #2
    Re: different way perhaps

    WHERE EXISTS can be used to determine if a record is returned in a subquery. Maybe you can use that in this case?

    Comment

    Working...
    X