简体   繁体   English

从DB2到Netezza的迁移

[英]DB2 to Netezza Migration

I have one query in DB2 which has mentioned below. 我在DB2中有一个查询,下面已经提到。 What would be the syntax for the same in NETEZZA? NETEZZA中相同的语法是什么?

select distinct acct_num from GTD_demo_dim where ACCT_NUM fetch first 1 rows only); 从GTD_demo_dim中选择不同的acct_num,其中ACCT_NUM仅获取前1行);

First, I don't think your statement is valid. 首先,我认为您的陈述无效。

select distinct acct_num from GTD_demo_dim where ACCT_NUM fetch first 1 rows only);

The where clause needs to be finished and you've used a closing parenthesis without an opening one. where子句需要完成,并且您已经使用了一个封闭的括号而没有一个开放的括号。

fetch first is common (standard?) ODBC syntax, so it's very likely that this will work. fetch first是常见的(标准?)ODBC语法,因此很有可能会起作用。 However, the usual way to do this in netezza is using a limit. 但是,在netezza中执行此操作的通常方法是使用限制。 All that said, this is how I'd query and expect the intended result (omitting your where since I can't infer the intent): 说了这么多,这就是我查询和期望预期结果的方式(由于我无法推断出意图where因此省略了您的where ):

select distinct acct_num from gtd_demo_dim limit 1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM