Pregunta

I want to update table sheet and set column value of hproject to 'yes' where customer having hproject='yes'

UPDATE `sheet` SET `hproject` =  'yes' WHERE (
SELECT `customer`
FROM `sheet`
WHERE `hproject` =  'yes'
)

Above query is not working, i'll be grateful for any help or guidance.

Regards

¿Fue útil?

Solución

try that :

  UPDATE `sheet` SET `hproject` =  'yes' WHERE `customer` in (
  select * from(
  SELECT `customer`
  FROM `sheet`
  WHERE `hproject` =  'yes'
 )t
 )
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top