gpt4 book ai didi

mysql - 需要 Netezza 中的标识符吗?

转载 作者:行者123 更新时间:2023-11-29 18:27:52 26 4
gpt4 key购买 nike

select dt_bill from db_activity 
(
select dt_bill bill_date , to_date(dt_bill, 'yyyy-mm-dd') bill_date
from db_activity a
where 1=1
)
where bill_date > to_date('01-JAN-0001')

我正在尝试将以某种格式设置的日期更改为另一种格式,不知道为什么它会给我这个错误:

ERROR [42000] ERROR:
found "SELECT" (at char 47) expecting an identifier found a keyword */

顺便说一句,我正在使用 Netezza,Aginity 工作台。

最佳答案

每个人在某种程度上都是正确的,似乎我在 Oracle 中使用的语法与该数据库的语法不同。

对于使用 Neteeza 的人员,请确保了解如何将某些数据库链接到您正在调用的表,例如:databasename.tablename。请引用与您一起工作且最熟悉数据库的人员。这个查询应该如何编写:

select c.dt_cash, 
c.at_pmt,
c.ky_ba,
d.dt_bill,
b.cd_res_comm,
to_date(d.dt_bill, 'yyyy-mm-dd') as bill_date,
sum (d.at_db) as sum_at_db
from css_p.source.cr_srce c -- **Notice how the database source is linked**
join css_p.source.db_activity d
on d.KY_BA= c.ky_ba
join css_p.source.bill_acct b --***schema name css_p is linked here****
on b.ky_ba = c.ky_ba
where d.dt_bill>= '2016-01-01'
and d.dt_bill<= '2016-04-01'
and b.CD_RES_COMM = 'R'
and c.KY_BA = XXXXXXXX -- **number is blocked out per privacy regulations**
group by c.dt_cash,
c.at_pmt,
c.ky_ba,
d.dt_bill,
b.cd_res_comm

请注意,它与您习惯在 Oracle 中工作的方式略有不同。希望这对你们中的一些人有所帮助!

关于mysql - 需要 Netezza 中的标识符吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46004295/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com