Help with UPDATE query

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

    #1

    Help with UPDATE query

    Hiya,
    I'm basically trying to keep a cached value of the result of a COUNT(*)
    command in a different table. My basic problem is that I don't know the
    syntax of what I want to do - I basically need a correct version of the
    following command:

    UPDATE sales, customer SET customer.orders = COUNT(*) FROM sales WHERE
    sales.cid = customer.id;

    If anyone could help, or point me in the direction of the correct resource
    then I'll be very grateful.

    R.
Working...