0

好吧,我整天都在尝试这样做。我知道以前有人问过这个问题并回答过这个问题,但我无法弄清楚如何完成这项工作。

UPDATE 'domain_main.registrarMultiID' =
(
    SELECT r.MultiID#, m.RecId, d.domainId
    FROM domain_main d, Master m, registrar_accounts_multi r
    WHERE d.domainId = m.RecId
    AND r.account = m.Account_CustomerNumber
    AND r.password = m.Password
    AND r.logonName = m.Logon_Username
)

我在这里想念什么?我知道我不应该在选择中引用 domain_main,但我不确定如何以另一种方式解决这个问题。

4

1 回答 1

1

你有错误的语法

  UPDATE 'domain_main.registrarMultiID' =
    (
        SELECT r.MultiID#, m.RecId, d.domainId
        FROM domain_main d, Master m, registrar_accounts_multi r
        WHERE d.domainId = m.RecId
        AND r.account = m.Account_CustomerNumber
        AND r.password = m.Password
        AND r.logonName = m.Logon_Username
    )

正确的语法如下。我假设您要将表列的值设置为属于表的registrarMultiIDdomain_main值。MultiID#registrar_accounts_multi

UPDATE 'domain_main' As d
INNER JOIN Master as m
   ON d.domainId = m.RecId
INNER JOIN registrar_accounts_multi as r
   ON r.account = m.Account_CustomerNumber
      AND r.password = m.Password
      AND r.logonName = m.Logon_Username
SET d.registrarMultiID = r.MultiID#
于 2013-10-03T06:48:06.633 回答