Subject RE: [ib-support] How to do a union?
Author Helen Borrie
At 10:36 AM 22-11-01 +0200, Gerhardus Geldenhuis wrote:

>Then I would want to itterate through this list and do the replication table
>by table.
>First problem some tables need to be replicated before others so the list
>needs to be
>sorted in a specific way. I cant sort it alphabetically so I need to lookup
>a
>weight for the table to know how to sort it. Here is typically what I would
>like to end up with after I have sorted it to weigth.
>
>TableName Weight
>MTRL_GLASSPRODUCTS 4
>MSFRAMES 8
>MSMOUNTS 9
>POS_MISC_STOCK 15
>POS_BILLOFMATERIAL 18
Gerhardus,
I think you are making this harder than it is.

This will get you that list:

select distinct rl.tablename, ro.weight
from replication_log rl
join replication_order ro
on rl.tablename = ro.tablename
where....

...originally, you said you wanted the output ordered...

good luck,
HB


All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________