>>>>Hi all,
>>>>Is there any quick way to merge 2 table into 1?
>>>>Thanks,
>>>>Tamas
>>>
>>>Depending on what do you mean by that - vertical or horisontal merge?
>>>
>>>If both tables have the same structure and you want to append records from one to another, then look into INSERT SQL or APPEND FROM commands.
>>>
>>>If you want to add extra fields, when how do you want to combine records - based on some key field?
>>
>>I'd like to merge them vertically.
>>for example:
>>
>>*********
>>table1
>>
>>field1 | field2
>>a1 | b1
>>a2 | b2
>>
>>*********
>>table2
>>
>>field3 | field4
>>c1 | d1
>>c2 | d2
>>
>>*********
>>mergedtable
>>
>>field1 | field2 | field3 | field4
>>a1 | b1 | c1 | d1
>>a2 | b2 | c2 | d2
>>
>
>Assuming that reccount() is the same in both tables.
>
>Select recno() as recnum,field1,field2 from table1 into cursot tmp1 nofilter
>Select recno() as recnum,field3,field4 from table2 into cursot tmp2 nofilter
>Select field1,field2,field3,field4 from tmp1 inner join tmp2 on tmp1.recnum=tmp2.recnum
>
>Use Outer Join in case of different record counts.
Thanks a lot, it works.