0

如何在 Zend DB 表上执行此操作?喜欢,

UPDATE location AS main
  SET main.parent_location = 28, 
  main.description = CONCAT(
          (SELECT sub.description FROM wms_location AS sub WHERE sub.id_location=28), 
           main.designation
      ) 
WHERE main.id_location in (11, 14);

这甚至可能吗?

4

1 回答 1

1
$table->update(
    "parent_location" => new Zend_Db_Expr(
        "CONCAT(" . (string)$subSelect . ", designation)"
    ),
    "id_location IN(11, 14)"
);

我不确定别名 - 它们是否可能以及是否需要它们。

于 2012-07-13T09:38:24.083 回答