@kenyon_君羊 你好,想跟你请教个问题:
在msql中可以实现这样的查询:
select id,name,3 as 'level','build' as 'nodeType', '' as 'hasOwner', housing_estate_id as pid , 'estate' as ptype
结果如下:
101 #1 3 build "" 71 estate 102 #2 3 build "" 71 estate 103 #3 3 build "" 71 estate 104 #4 3 build "" 71 estate 105 #5 3 build "" 71 estate 106 #6 3 build "" 71 estate
但在postgresql 中如果使用dblink语法就会报错
select t1.* from dblink('lz_base_dblink','select id,name,1 as "level","estate" as "nodeType" from housing_estate where is_deleted = 0') as t1 (id numeric(20,0),name varchar(50),level integer,nodeType varchar(50));
错误信息:
ERROR: syntax error at or near "estate" LINE 1: ...nk('lz_base_dblink','select id,name,1 as "level",'estate' as... ^
换成E'\estate'或''estate''试一下
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。