Re: SQL Question
Posted in 1997
On 24 Jun 1997, Jim Kist wrote: } I have a set of tables, a master table and two detail tables. The detail } tables have at most 5 records for each master record. I need to move these } records to a flat file that has one record each set of master detail } records. How do I go about doing this? } } Example: } Master Table } =========== } Id } Name } City } } Detail Table 1 } =========== } Id } Code } } Detail Table 2 } =========== } Id } Date } } All tables are related by the 'Id' field. These records must go into the } following table: } } Output } =========== } Id } Name } City } Code_1 } Code_2 } Code_3 } Code_4 } Code_5 } Date_1 } Date_2 } Date_3 } Date_4 } Date_5 } } I have a similar problem, except that there is no fix number of record on the detail table which related to the master table. With ESQL/C's cursor function, I can do it. But some the web development tools I am using can only accept SQL statement or SPL. So, wondering is it possible to do this with just SQL or SPL?