Selecting multiple members at a time in SQL

620 pts.
Tags:
AS/400
SQL
I have customer file (CUSFILE),this file having 3 members (JAN, FEB, MAR). Using ALIAS,I can select only one member.
CREATE ALIAS CUSMBR1 FOR CUSFILE(JAN).

SELECT *FROM CUSMBR1.
How to select multiple members at a time in SQL. Please help me.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Splat
    One way I know of is to execute an OVRDBF command prior to the SELECT statement.
    12,875 pointsBadges:
    report
  • ToddN2000
    Where are you running this command in VB, SQL, SQLRPGLE? There are a few ways you might do this but it depends on how it's being run.
    132,520 pointsBadges:
    report
  • philpl1jb

    CREATE ALIAS CUSMBR1 FOR CUSFILE(JAN)
    CREATE ALIAS CUSMBR2 FOR CUSFILE(FEB)

    CREATE ALIAS CUSMBR2 FOR CUSFILE(MAR)

    SELECT *FROM CUSMBR1

    UNION

    SELECT *FROM CUSMBR2

    UNION

    SELECT *FROM CUSMBR3


    54,090 pointsBadges:
    report
  • Splat
    philpl1jb, nice.  I wouldn't have thought of approaching it that way.
    12,875 pointsBadges:
    report
  • philpl1jb

    Is this an interview question?

    54,090 pointsBadges:
    report
  • ToddN2000
    Sounds like it. The poster has asked a lot of interview type questions lately. I hope we all get hired. LOL.
    132,520 pointsBadges:
    report
  • chowas400
    No Philpl1jb, its a general question.

    Thank you so much for your help..
    620 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: