"at the bottom of" has no real meaning in relational databases. Data goes
wherever the DBMS can fit it. If the order of the records is important, make
sure you have a field that you can use in an ORDER BY clause in your query.
Tables don't really have orders. The are more like buckets of data than
list.
If you want to keep data in a specific order, you really need a filed or
group of fields that can be sorted to that order. (Note: autonumbers are
not guaranteed to provide consecutive or consistent order.)
I have two tables.. Collections and CheckVouchers
What I'm trying to accomplish is that there are fields in each table that
are the same(Collections and CheckVouchers) but the two tables are not
union-compatible. I need to make a query out of these fields so that i can
group the field Payee and their transactions to generate a report.
I have two tables.. Collections and CheckVouchers
What I'm trying to accomplish is that there are fields in each table that
are the same(Collections and CheckVouchers) but the two tables are not
union-compatible. I need to make a query out of these fields so that i can
group the field Payee and their transactions to generate a report.
You don't need to select *all* the fields for a Union query; if you
just want to union a few of the fields in the two tables, just select
those fields:
SELECT Field1, Field8, Field9 FROM Collections
UNION
SELECT Field3, Field11, Field12 FROM CheckVouchers;
The fact that other fields don't match is irrelevant - all that is
required is that each SELECT includes the same number of fields of
matching datatypes.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.