I am trying to update the column CreditCode in a table extract using data from another table CreditCodes, which has columns CreditCode and Consumer_No.

I have been given the following sql which works on another database (not sure which and it is late at night so I can't ring up and ask)

update extract
    set CustomerCreditCode = b.CreditCode
    from extract a
    inner join CreditCodes b
    on a.ConsumerNO = b.Consumer_No;

This gives an error in mysql:
ERROR 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from extract a
inner join CreditCodes b
on a.ConsumerNO = b.Cons

Can anyone translate it into correct mysql syntax for me?

Thanks

David Scott

_________________________________________________________________
David Scott     Department of Statistics, Tamaki Campus
                The University of Auckland, PB 92019
                Auckland 1142,    NEW ZEALAND
Phone: +64 9 373 7599 ext 86830         Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]

Graduate Officer, Department of Statistics
Director of Consulting, Department of Statistics


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to