从表中提取特定值

发布于 2025-01-17 01:23:30 字数 230 浏览 1 评论 0原文

我有 tabe:

As: 11 43 23 67 76 
Bs: 87 38 70 8 10 
syms:A`B where 4 4
AA:([] A:As;B:Bs)
1#select A from AA

我得到输出

A 
--
11

我想知道如何只返回值而不是让输出成为表格?因此,在这种情况下,它只会返回 11。

I have the tabe:

As: 11 43 23 67 76 
Bs: 87 38 70 8 10 
syms:A`B where 4 4
AA:([] A:As;B:Bs)
1#select A from AA

I get the output

A 
--
11

I would like to know how to just have the value returned instead of having the output to be a table? So, in this case, it would just return 11.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

望喜 2025-01-24 01:23:30

众多方法之一

q)AA[0]`A
11

执行此操作以同时获取最后一项

q)last[AA]`A
76

或两项的

q)(first;last)@\:AA`A
11 76

One of numerous ways to do this

q)AA[0]`A
11

to get last item

q)last[AA]`A
76

or both at once

q)(first;last)@\:AA`A
11 76
花伊自在美 2025-01-24 01:23:30

当您希望将列值作为列表时,您需要使用 exec 关键字而不是 select

1#exec A from AA

You want to use the exec keyword instead of select when you want column values as a list:

1#exec A from AA
ι不睡觉的鱼゛ 2025-01-24 01:23:30

尝试使用 exec 而不是 select,它将仅返回列表中的值。

注意:如果查询位于 hdb 中/分区数据库中,那么您需要先选择,然后执行。

Try using exec instead of select, which will return just the value in a list.

Note: If the query is in a hdb / on a partitioned db then you'll need to select first then exec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文