This is not possible at the moment and the best way I can think of is to
separate them into 2 separate queries using the returned value of the select
as the input value for the update.

----- Original Message -----
From: "Paulo Francioli DETRAN" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 4:35
Subject: update


How do I do to execute a UPDATE using sub query as in the example below?
update veiculo2000
set
     marca = ( select  arq2.marca from    veiculo arq2
                                                           where
veiculo2000.status_veic = '0'
                                                            or
veiculo2000.status_veic = '3'
                                                            or
veiculo2000.status_veic = '6'
                                                            or
veiculo2000.status_veic = '7'
                                                           and
substring(veiculo2000.placa_veic,3,1) <> ' '
                                                           and
veiculo2000.placa_veic = arq2.placa_veic
                                                           and
veiculo2000.marca <> arq2.marca  )




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to