概述
select
PT_HC_H16.HEALTH_RECORD_CODE as HEALTH_RECORD_CODE
,PT_HC_H16.NAME_GB as NAME_GB
,PT_HC_H16.REFERRAL_GB as REFERRAL_GB
,PT_HC_H16.INPUT_MAN_GB as INPUT_MAN_GB
,PT_HC_H16.VISIT_DATE_GB as VISIT_DATE_GB
,PT_HC_H16.SBP_GB as SBP_GB
,PT_HC_H16.HEALTH_INSTRUCTION_GB as HEALTH_INSTRUCTION_GB
,PT_HC_H16.HEALTH_STATE_GB as HEALTH_STATE_GB
,PT_HC_H16.PSYCHOLOGY_STATE_GB as PSYCHOLOGY_STATE_GB
,PT_HC_H16.LMAMILLA_STSTUS_GB as LMAMILLA_STSTUS_GB
,PT_HC_H16.LYMA_DESC_GB as LYMA_DESC_GB
,PT_HC_H16.UTERINE_DESC_GB as UTERINE_DESC_GB
,PT_HC_H16.CUT_DESC as CUT_DESC
,PT_HC_H16.NEXT_VISIT_DATE_GB as NEXT_VISIT_DATE_GB
from PT_HC_H16 t
left join
GWC_BASEDATA_DETAIL a
on a.BASEDATACLASS_CODE = 'CV04.10.012'
and a.ITEM_CODE = t.LMAMILLA_STSTUS_GB
left join
GWC_BASEDATA_DETAIL a
on a.BASEDATACLASS_CODE = 'CV06.00.219'
and a.ITEM_CODE = t.HEALTH_INSTRUCTION_GB
执行错误,是因为给PT_HC_H16起别名为t,就不能再用PT_HC_H16的表名
最后
以上就是满意耳机为你收集整理的sql中给表起别名问题的全部内容,希望文章能够帮你解决sql中给表起别名问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复