Subject Re: Merging 2 dbf
From Akshat Kapoor <>
Date Fri, 6 Dec 2019 17:18:29 +0530
Newsgroups dbase.getting-started

On 06-12-2019 16:57, Randy Waldman wrote:
> Akshat - so good to hear from you!  Thanks for the reply.  My further question: can I use WHERE clauses in my Union?  Do you possibly have an example of such?

Using WHERE in union should work. Union just joins two sql statements
(Matching of fields is mandatory). Each of the sql statements can be
having conditions.

But I have switched to MariaDB hence do not have any meaningful data in
dbf tables hence just performed a simple check. It worked.

select company,directory from company2 where company = "XXXXXXXX" union
select company,directory from company

I would recommend some checking before deploying.
(Company and company2 have different structures so I used the common
fields only)

Prepare the two statements execute them and note down the number of rows
in each.
Then join them using union and then check the number of rows.

Please note :
The rowset so generated will be readonly.