About syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thao
    New Member
    • Apr 2011
    • 2

    About syntax

    Hi,
    Could you please help me to find my syntax errors in the query below:
    Code:
    select avg(hd) as AVG_HD
    from (Product inner join PC on Product.model=PC.model) T
    where exists (select * from Product where type='Printer' and T.maker=maker)
    Thanks in advance!
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32668

    #2
    Thao, when posting questions here please remember to provide the basic information such as any error messages and which lines they are associated with. Wasting our time to save you yours is not greatly appreciated.

    In this case your use of [T] is out of place. It should be found after a table (or record source) name. Not after the whole FROM clause. EG:
    Code:
    FROM (Product AS T
          INNER JOIN
          PC
      ON  Product.model=PC.model)
    Or, alternatively :
    Code:
    FROM (Product
          INNER JOIN
          PC AS T
      ON  Product.model=PC.model)
    Depending on which you wish to refer to as T.

    Comment

    Working...