nz_migrate中的子查询

时间:2017-11-06 10:57:57

标签: netezza

我需要使用where子句中的以下给定子查询在netezza中迁移数据。

示例: - -sourcewhereclause"从abc..table1中选择*,其中id为(从xyz..table2中选择id)"

请告诉我这是可能的。

1 个答案:

答案 0 :(得分:2)

如nz_migarte帮助中所述,您可以指定source子句子查询过滤器,但是,您只需要提供查询的where部分

  
    

-SourceWhereClause

  
# Normally, nz_migrate is used to migrate over the entire contents of a
# table -- all visible rows.  This option allows "you" to tack on a WHERE
# clause to the data that gets selected ... allowing "you" to migrate a
# subset of the table.  All the power (and responsibility) is put into your
# hands.  Do wrap the clause in double quotes so it will be passed into the
# script correctly.  Examples:
#
#    -SourceWhereClause  "customer_key = 2"
#    -SourceWhereClause  "customer_key in (1,3,5)"
#    -SourceWhereClause  "region_name = 'AMERICA' or region_key = 0"
#    -SourceWhereClause  "order_date between '1998-01-01' and '1998-12-31'"
#    -SourceWhereClause  "customer_num in (select cust_id from sales..delinquent_accounts)"

示例: -

-sourcewhereclause "id in (select id from xyz..table2)"