0

我的高级技术人员准备了一个视图。查看源脚本,我无法理解该列的label存在位置,因为两个表都不包含该列。它是作为视图的一部分存在的列吗?

select label labelName
, e.name
, e.country 
from entity e

源脚本:

SELECT e.entity_id
, se.screen_id
, s.country_code
,desc_trans translatedValue
, et.language_code
, cp.NAME name
FROM entity e 
LEFT OUTER JOIN CONTROL_PREFIX cp 
    ON e.CONTROL_PREFIX_CODE = cp.CONTROL_PREFIX_CODE
, entity_trans et
, screen s
, screen_entity se
WHERE e.entity_id = et.entity_id 
AND e.entity_id = se.entity_id 
AND se.screen_id = s.screen_id 
AND e.entity_type_code = 'LB'

UNION

SELECT e.entity_id
, se.screen_id
, s.country_code
, field_name labelName
, label labelText
, NULL translatedValue
, l.language_code
, cp.NAME name
FROM entity e 
LEFT OUTER JOIN CONTROL_PREFIX cp 
    ON e.CONTROL_PREFIX_CODE = cp.CONTROL_PREFIX_CODE
, language l
, screen s
, screen_entity se
WHERE l.language_code NOT IN
(
    SELECT et1.language_code
    FROM entity e1
    , entity_trans et1
    WHERE e1.entity_id = et1.entity_id 
    AND e1.entity_id = e.entity_id 
    AND e1.entity_type_code = 'LB'
) 
AND e.entity_type_code = 'LB' 
AND s.screen_id = se.screen_id 
AND e.entity_id = se.entity_id;
4

1 回答 1

0

假设您发布的SQL是用于生成视图的SQL并且是完整的

IE

create view myView as
select label labelName
, e.name
, e.country 
from entity e

Label在表格上,Entity但在视图中显示myViewLabelName

如果entity是视图的名称,您需要提供该视图背后的源代码。

于 2012-12-13T20:32:47.893 回答