Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 使用Redshift卸载SELECT语句\\_Amazon Web Services_Amazon Redshift - Fatal编程技术网

Amazon web services 使用Redshift卸载SELECT语句\\

Amazon web services 使用Redshift卸载SELECT语句\\,amazon-web-services,amazon-redshift,Amazon Web Services,Amazon Redshift,如果AWS Redshift unload语句中包含以下语句,且具有以下语法: SELECT \\'{{"id":"\\' || id || \\'",\\' || url || ltrim(home, \\'{{\\') from users_details 这个\意味着什么 python脚本中的完整语句是: UNLOAD (' SELECT \\'{{"id":"\\' || id || \\'",\\' || url || ltrim(home, \\'{{\\')

如果AWS Redshift unload语句中包含以下语句,且具有以下语法:

SELECT \\'{{"id":"\\' || id || \\'",\\' || url || ltrim(home, \\'{{\\')
from users_details
这个\意味着什么

python脚本中的完整语句是:

UNLOAD ('
        SELECT \\'{{"id":"\\' || id || \\'",\\' || url || ltrim(home, \\'{{\\')
        FROM users_details
    ')
TO {AWS Bucket}
    ALLOWOVERWRITE
    DELIMITER AS '\\t';

似乎作者试图在查询中转义引号

它使用
\'
表示一个引号内的引号,第一个
\
阻止Python尝试解释第二个
\

但是,有一种更好的方法,如所示:

如果查询包含引号(例如,将文字值括起来),请将文字置于两组单引号之间。您还必须将查询括在单引号之间:

('select * from venue where venuestate=''NV''')

谢谢但从中提取数据的列是从右上角开始的?该行将包括
id
url
home
中的值。