Richard Hipp wrote...

On Wed, Jul 23, 2014 at 12:32 PM, jose isaias cabrera <cabr...@wrc.xerox.com
wrote:


Greetings.

I have two DB identical and I am copying data from one to another.

When I attach a DB, i.e..

ATTACH 'c:\db\mydb.sqlite' as client;

how do I address the names of the column? for example, both DBs connected and disconnected have the columns: id,ProjID, Date, code, login. When I do
this command,

BEGIN;
 INSERT OR REPLACE INTO LSOpenProjects
   SELECT * FROM client.LSOpenProjects
     WHERE client.LSOpenProjects.ProjID <= 133560 AND
           Date != client.LSOpenProjects.Date AND
           client.LSOpenProjects.login = 'user1';
END;


The main.LsOpenProjects is not in scope for the SELECT statement so you can
omit the "client.LSOpenProjects." prefix if you like.  On the other hand,
what you wrote works, so what's the problem?

No problem. I just wanted to see if there was another way of writing it. So, what you are saying is that this,

INSERT OR REPLACE INTO LSOpenProjects
   SELECT * FROM client.LSOpenProjects
     WHERE ProjID <= 133560 AND
           Date != Date AND
           login = 'user1';

is the same as above?  Ok, I think I wrote this one wrong.  This statement,

           Date != client.LSOpenProjects.Date

is it really,

main.LSOpenProjects.Date != client.LSOpenProjects.Date

or am I just writing Junk SQL? Sorry for the newbie question. What I would like is to INSERT anything that from the client.LSOpenProjects.Date != main.LSOpenProjects.Date. Thanks for the help.

josé


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to