1

我正在尝试对多值 UniData 字段的第一个和第二个元素中包含重复值的记录进行临时搜索。我希望这样的事情会奏效,但我没有任何运气。

LIST PERSON WITH EVAL "STATUS[1] = STATUS[2]"

经过一些测试,看起来我偶然发现了一种从右到左读取这么多字符的方式。有趣但对我需要的东西没有用。

LIST PERSON NAME EVAL "NAME[3]" COL.HDG 'Last3'

PERSON Name  Last3
0001   Smith ith

关于如何正确选择特定字段元素的任何想法?

显然 EXTRACT 函数可以让我指定一个元素,但我仍然无法对其进行选择以正常工作。

LIST PERSON STATUS EVAL "EXTRACT(STATUS,1,2,0)" COL.HDG 'Status2'

PERSON STATUS    Status2
0001   Added     Processed
       Processed 
4

1 回答 1

2

I would use eval with @RECORD placeholder with the dynamic array notation as such (assuming that STATUS is in Attribute 11.

Edit: Previous answer was how I would do this in UniVerse

SELECT PERSON WITH EVAL "@RECORD<11,1>" EQ EVAL "@RECORD<11,2>"

Script Wolf's more better way that works in UniVerse and UniData.

SELECT PERSON WITH EVAL "EXTRACT(@RECORD,11,1,0)" EQ EVAL "EXTRACT(@RECORD,11,2,0)"

Good Luck.

于 2018-10-04T22:20:56.657 回答