Select with aliases, please help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lukit

    Select with aliases, please help

    UPDATE [TABLE1] SET Stat="T",Transf eredTo=b.Store
    FROM [TABLE1] a
    WHERE stat = "PS"
    AND EXISTS(
    SELECT b.* from [TABLE2] b WHERE a.Model=b.Model AND a.Make=b.Make AND
    a.Year=b.Year AND a.Trim=b.Trim AND a.DoorsBody=b.D oorsBody AND
    a.Price=b.Price AND a.Color=b.Color AND a.Trans=b.Trans AND a.Cyl=b.Cyl
    AND a.Miles=b.Miles AND a.Store=b.Store AND b.New="N")

    I got error:

    [Microsoft][ODBC SQL Server Driver][SQL Server]The column prefix 'b'
    does not match with a table name or alias name used in the query.

    Please help me, it`s all about b.Store

Working...