"Gilles Ganault" <gilles.gana...@free.fr> wrote in
message news:h0kkr4993udaujhneohd4nacpfnp73p...@4ax.com
> I have two SQLites databases that I need to merge. Some companies are
> found in both, so I'd like to only keep one record when this occurs.
>
> What would be the right way to do this?

If the company name is declared unique, then simply

insert or ignore into tbl1
select * from tbl2;

Otherwise, you'd need something like this:

insert into tbl1
select * from tbl2 where company not in
(select company from tbl1);

Igor Tandetnik



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

Reply via email to