SELECT with LIMIT in AS/400

250 pts.
Tags:
AS/400 Parameters
AS/400 Records
SQL
SQL Select
Hi all,

On my AS400, I need to select the first 90 records from one file and insert them into another file, but all the time i got all records in my result file. Is there any way to use the parameter LIMIT with my SQL SELECT

INSERT INTO LIB1/FILE1 (FILE1) SELECT DISTINCT                  (substring(FILE1, 1, 100)) FROM FILE1 WHERE FILE1 like '%xxxx%'  

thank you



Software/Hardware used:
AS400

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Try using the fetch-first-clause as in FETCH FIRST 90 ROWS ONLY. Although the link is for i 7.1 DB2, the clause should work in any current release. Tom
    125,585 pointsBadges:
    report
  • junioras400
    All the time you have an answer...thanks a lot Tom you are an IT god loool
    250 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following