On Tuesday 17 April 2007 15:17, Alexander B. wrote:
Hello,
I need to create a function that find data over 3 tables, merge and
return data.
With example can be specified more clearly:
1.1 Find all addresses code;
1.2 For each addresses code, get address, complement and city on the
first
The magic you're looking for is UNION ALL.
You could just union the two address tables together and join that to
the address code table, but that'll probably lead to an inefficient
plan. You'll likely need to join the address code table to each address
table separately, and then UNION ALL those
Hello,
I need to create a function that find data over 3 tables, merge and
return data.
With example can be specified more clearly:
1.1 Find all addresses code;
1.2 For each addresses code, get address, complement and city on the
first table;
1.3 For each addresses code, get address, complement