Bob Lockie <[EMAIL PROTECTED]> wrote:
> What I really want was
> mysql> update records set records.prio=2 where records.in=(select 
> records.id from records, audit_log, audit_log_records where 
> audit_log.tracker_id=audit_log_records.tracker_id and 
> records.id=audit_log_records.id and audit_log.operation='D' and 
> audit_log.completed is null);
> but that gives a syntax error and I don't think I can do a select inside 
> an update. :-(
> 
> mysql> update records set records.prio=2 where 
> audit_log.tracker_id=audit_log_records.tracker_id and 
> records.id=audit_log_records.id and audit_log.operation='D' and 
> audit_log.completed is null;
> 
> ERROR 1109: Unknown table 'audit_log' in where clause
> 

You must specify 'audit_log' and 'audit_log_records' tables too. 

UPDATE records, audit_log, audit_log_records
SET records.prio=2
WHERE ..



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




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

Reply via email to