Re: Append Query SQL

From: Eric G (EricG_at_ether.net)
Date: 04/30/04


Date: Fri, 30 Apr 2004 05:04:06 GMT

Hi Michel,

   Thanks very much! That was a perfect solution.

         Eric

> Make a backup. Try:
>
> INSERT INTO tableb(f1, f2, f3, f4, f5)
> SELECT tablea.f1, tablea.f2, tablea.f3, tablea.f4, tablea.f5
> FROM tablea LEFT JOIN tableb
> ON tablea.f1 = tableb.f1 AND tablea.f2=tableb.f2
> WHERE tableb.f1 IS NULL
>
>
>
>In fact, the SELECT portion (the query, without the first line) should
>return the records in tablea not in tableb, accordingly to your criteria.
>
>
>
>
>Hoping it may help,
>Vanderghast, Access MVP



Relevant Pages

  • Re: Need help in Query -
    ... Try this query: ... LEFT JOIN TableB b ... This will locate rows in TableA without a counterpart in TableB. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Advanced query issue
    ... FROM tablea As a RIGHT JOIN tableb as b ... That assumes tableb has all the possible occurrence of the two ... I also used UNION ALL, ...
    (microsoft.public.access.queries)
  • Re: Checking number of records
    ... FROM TableA ... JOIN TableB ON TableB.RecordID = TableA.RecordID ... > How can I write a query that would give me a record number of every record ... > needs to have 4 entries for every record that exists in another table. ...
    (microsoft.public.sqlserver.programming)
  • Re: Multiple outer joins in access
    ... FROM (TableA LEFT JOIN TableB ... LEFT JOIN TableC ON ... TableA to TableB and From TableA to TableC. ... The fields that hold the foreign keys may have valid long integer ...
    (microsoft.public.access.queries)
  • Re: if exists queries
    ... from tableA left outer join tableB ... If the tableB.c value is never 'coff' when a = b, ... >not fit a criteria on the second table. ...
    (microsoft.public.sqlserver.programming)