× 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.



Can you post some data and what you want as final result? Because I miss
something here, but don't know what.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Tuesday, October 03, 2006 11:20 AM
To: RPG programming on the AS400 / iSeries
Subject: creating a file via SQL

Morning all
I am giving myself a headache in trying to solve a problem with SQL
I've tried looking through the archives, but I am not really too sure
what
I am looking for.
Anyway, if anyone can help me,

The problem is as follows:-
I have 2 files, in their simplistic form
FileA
Order number
Item number
Quantity
Category
Sub category

FileB
Item number
Category
Sub category

In FileB, Item number is NOT unique. Item number within Category IS
unique.
For example Item number 000001 can be in Category 0001 AND in Category
0094
What I want to happen is that for an order that contains item number
000001, I want a file (FileC) that contains 2 records from the original
1.
One record with Category 0001 and the other record with category 0094.
FileA to FileC is a one to many ratio.
The other problem is if the item number does NOT exist on FileB, FileC
should contain one record with 0 category.

I think that's it.
If anyone can help, or point me in the right direction, I would be VERY
grateful

Thanks in advance



Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.