Re: What's wrong with this UPDATE stmt?
- From: "tina" <nospam@xxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 05:51:36 GMT
> The FROM clause used here creates a cross product.
is that the same as a cartesian product?
> When combined as shown
> with a WHERE clause between the two tables, the result is identical to an
> INNER JOIN. Indeed, this is an old version of how INNER JOINs are
written.
thanks, Tom, learn something new every day here (not a hard assignment when
it comes to me! <g>).
and i do agree with you that adding the Customer name to the Orders table is
a violation of normalization rules. :)
"Tom Ellison" <tellison@xxxxxxxxxxx> wrote in message
news:ewmo%23Yl7FHA.2012@xxxxxxxxxxxxxxxxxxxxxxx
> Hello, tina:
>
> The FROM clause used here creates a cross product. When combined as shown
> with a WHERE clause between the two tables, the result is identical to an
> INNER JOIN. Indeed, this is an old version of how INNER JOINs are
written.
>
> The duplication of CustomerName in the Orders table is likely a violation
of
> the Rules of Normalization. Better that not be in the Orders table at
all.
> A join on CustomerID should be used to retrieve the CustomerName from the
> Customers table.
>
> Tom Ellison
>
>
> "tina" <nospam@xxxxxxxxxxx> wrote in message
> news:rIagf.138566$zb5.4680@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > does "Orders o" mean that you're aliasing the Orders table to "Orders As
> > o"?
> > and ditto "Customers c" to "Customers As c"? and are the two tables not
> > joined in the query, with a LEFT JOIN, RIGHT JOIN, OR INNER JOIN?
> >
> > hth
> >
> >
> > "Tony Lin" <tony@xxxxxxxxxxxxx> wrote in message
> > news:VvudnV54ectRsRzenZ2dnUVZ_sqdnZ2d@xxxxxxxxxxxxxx
> >> I'm looking for help as to why the following UPDATE statement won't
> > execute
> >> in Access:
> >>
> >> UPDATE Orders
> >> SET CustomerName = c.CustomerName
> >> FROM Orders o, Customers c
> >> WHERE o.CustomerID=c.CustomerID;
> >>
> >> It results in the following error message in Access:
> >>
> >> Syntax error (missing operator) in query expression 'c.CustomerName
> >> FROM
> >> Orders o'
> >>
> >> CustomerID is the primary key of the Customers table.
> >>
> >> Tony
> >> Fremont, CA
> >>
> >>
> >
> >
>
>
.
- Follow-Ups:
- Re: What's wrong with this UPDATE stmt?
- From: Tom Ellison
- Re: What's wrong with this UPDATE stmt?
- References:
- What's wrong with this UPDATE stmt?
- From: Tony Lin
- Re: What's wrong with this UPDATE stmt?
- From: tina
- Re: What's wrong with this UPDATE stmt?
- From: Tom Ellison
- What's wrong with this UPDATE stmt?
- Prev by Date: Re: What's wrong with this UPDATE stmt?
- Next by Date: Re: What's wrong with this UPDATE stmt?
- Previous by thread: Re: What's wrong with this UPDATE stmt?
- Next by thread: Re: What's wrong with this UPDATE stmt?
- Index(es):
Relevant Pages
|