Syntax Problem

From: Wayne Wengert (wayneDONTWANTSPAM_at_wengert.com)
Date: 06/21/04


Date: Mon, 21 Jun 2004 08:36:41 -0600

I am trying to put the result of a select statement into a new table. The
statement I am trying to use is below - it fails with a complaint about the
parens. I can't seem to figure out the correct way to write this

==========================================
select
    *
into
    Test1
from
(SELECT DISTINCT tmpMailList.NamesID, Names.FirstName, Names.LastName,
Names.Addr1, Names.Addr2,
 Names.City, Names.StateProv, Names.ZIP, Names.Country, Names.DayPhone,
Names.Email, Units.FullName,
Units.HomeCity, Units.HomeState, Units.HomeCountry, Units.CG, Units.Class
FROM (tmpMailList INNER JOIN [Names] ON tmpMailList.NamesID = Names.NameID)
Inner Join Units On Names.NameID = Units.Contact
WHERE tmpMailList.NamesID IN (45895, 44900, 775, 49225, 49199, 2116, 2436,
2834, 2898, 44169, 3236,
3256, 3907, 4003, 49057, 49511, 5480, 46270, 6917, 7409, 8914, 9288, 49393,
10062, 10737, 47017, 11142,
11378, 11569, 11661, 34186, 14998, 15177, 47266, 48973, 16920, 17085, 46833,
18120, 18961, 19691))



Relevant Pages

  • Re: Multiplying Records
    ... SELECT RawReport.Name AS Expr1, Units., Shifts. ... FROM (RawReport INNER JOIN Units ON (RawReport.Div = ...
    (microsoft.public.access.queries)
  • Still need help with multiplying records
    ... SELECT RawReport.Name AS Expr1, Units., Shifts. ... FROM (RawReport INNER JOIN Units ON (RawReport.Div = ...
    (microsoft.public.access.queries)
  • Re: query multi tables, count/sum 1 of the tables
    ... >I'm quering about 5 tables using inner join. ... >want to count or sum up the results. ... INNER JOIN Units ...
    (microsoft.public.sqlserver.mseq)
  • Re: Stuck on a Query
    ... Inner Join Units ON tmpMailList.NamesID = Units.UnitID ... LEFT JOIN Names Names2 ON Units.Contact2 = Names.NameID ...
    (microsoft.public.sqlserver.programming)