On 07/28/2012 03:42 PM, Lynne Stevens wrote:
omega
The
Omega sector
America's Last
Line of
Defense
*Oh yeah both files are CVS and are the way Thomas downloads them but
being he is not to computer literate and most likely does not know he
can save it in different ways . . No telling . . I ask one time and he
said that is how it gets downloaded
Lynne,
What I think you are doing is loading two tables from csv files into the
*same* database. With databases one finds there is a fairly precise
terminology used. Once you have the data loaded then on can query the
data. The tables do not need to have the same structure only be related
in some logical manner.
If I understand the project you download a CSV file with addresses that
has many duplicates of data in a table in the database. The next step is
find only those addresses that are not duplicates so they can be
appended to the existing table.
If you upload the new data into a table (Temp) you can then write a
query to find new/updated entries in the existing table (Addresses).
Roughly the query would look something like this
SELECT relevant columns from Temp, each column listed in the following
format t.columnname
FROM Temp AS t, Addresses AS a (using an alias you do not need to type
the full table name)
WHERE t.columnname != a.columnname - more than one criteria can be used
such as customer name, address, city, phone number, etc to identify the
duplicates.
For the WHERE clause I would look for some unique id used in the data
sets, such as a customer number.
*
On 07/28/2012 09:39 AM, Alexander Thurgood wrote:
Le 28/07/12 14:17, Lynne Stevens a écrit :
Hi Lynne,
*How do I check for duplicates in a data base using another data base ?
By "another data base", do you mean :
(a) another ODB file ?
(b) another type of database manager, e.g. Access vs Calc, or MySQL vs
Access, or even Access vs Access ?
(c) another table in the same ODB file or in the same database schema
managed by a unique database manager ?
(d) any or all of the above combined ?
As you can see, the possibilities belie what would appear to be a
seemingly simple question.
Andreas has answered (c) for you, i.e. where both tables are in the same
database schema.
There is no simple way to compare the contents of 2 HSQLDB/ODB files,
other than extracting the contents from one and importing it into the
other as a temporary or new table and then comparing the table results
from within the single ODB file using a JOIN query.
As for (b) LO Base does not allow you to adress two separate database
schema as far as I know from within a single query. I heard tell once
that it might be possible with Access tables being read by LO if an ODBC
connection was being used, and this only would work on Windows. Not
having tried it, I can't say whether it is true or not.
If what you are aiming for is indeed cross-schema queries in order to be
able to compare, this has been a requested (and never implemented)
feature in OpenOffice.org for many years.
Alex
--
Jay Lozier
[email protected]
--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted