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

I presume that LSOpenProjects in both databases has a unique constraint on 
ProjID, Date, and login ...

>-----Original Message-----
>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
>boun...@sqlite.org] On Behalf Of jose isaias cabrera
>Sent: Wednesday, 23 July, 2014 10:32
>To: General Discussion of SQLite Database
>Subject: [sqlite] Addressing columns in an attached db
>
>
>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;
>
>So, is there a different way of addressing the attached DB table columns?
>Any help would be greatly appreciated.  thanks.
>
>josé
>
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@sqlite.org
>http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



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

Reply via email to