-1

我正在尝试通过实体框架更新 MySQL 视图并收到错误“每个派生表都必须有自己的别名”。

关于如何改变我的观点以防止这种情况的任何想法?这是我的 MySQL 视图代码:

    select 
  a.compid AS compid,
  a.loid AS loid,
  a.purchase_rate AS purchase_rate,
  a.purchase_min AS purchase_min,
  a.purchase_max AS purchase_max,
  a.refi_rate AS refi_rate,
  a.refi_min AS refi_min,
  a.refi_max AS refi_max,
  a.quarter AS quarter,
  a.year AS year,
  a.changed_on AS changed_on,
  a.user_changed AS user_changed,
  a.is_active AS is_active,
  a.notes_id AS notes_id,
  b.branch AS branchID,
  b.name AS lo_name,
  c.branch_name_friendly AS branchname 
from ((encompassdata.comp a 
  inner join default.users_encompass b on
    (
      (a.loid = b.un_enc)
    )) 
  inner join default.branch_info c on
    (
      (b.branch = c.branch_id)
    ))
4

1 回答 1

0

尝试删除FROM子句中的所有括号

SELECT a.compid AS compid,
       ...
  FROM encompassdata.comp a INNER JOIN
       default.users_encompass b on a.loid = b.un_enc INNER JOIN
       default.branch_info c on b.branch = c.branch_id
于 2013-03-22T01:05:13.867 回答