viking2 <[EMAIL PROTECTED]> wrote:
I have a database (*.db3) with 3 tables:
CREATE TABLE TB_Signature (Filename TEXT, FileSignature TEXT, FileSize
INTEGER, FileDate INTEGER, PRIMARY KEY (FileSignature,FileSize));
CREATE TABLE TB_FileRecords (pszFilename TEXT PRIMARY KEY, nFileSize
INTEGER, nFileSignature TEXT);
CREATE TABLE TB_SignatureRecords (nFileSignature TEXT PRIMARY KEY,
nFileDate INTEGER );
I want to merge the bottom two tables, TB_SignatureRecords &
TB_FileRecords, into the top one, TB_Signature so that:
from TB_SignatureRecords:
nFileSignature goes to 2nd column in TB_Signature
nFileDate goes to 4th column in TB_Signature
from TB_FileRecords:
pszFilename goes to 1st column in TB_Signature
nFileSize goes to 3rd column in TB_Signature
insert into TB_Signature(Filename, FileSignature, FileSize, FileDate)
select fr.pszFilename, fr.nFileSignature, fr.nFileSize, sr.nFileDate
from TB_FileRecords fr join TB_SignatureRecords sr
on (fr.nFileSignature = sr.nFileSignature)
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------