[英]Show UniData SELECT results that are not record keys
I'm looking over some UniData fields for distinct values but I'm hoping to find a simpler way of doing it. 我正在查看一些UniData字段以查找不同的值,但我希望找到一种更简单的方法。 The values aren't keys to anything so right now I'm selecting the records I'm interested in and selecting the data I need with SAVING UNIQUE.
这些值并不是任何内容的关键,所以现在我要选择自己感兴趣的记录,并通过SAVING UNIQUE选择所需的数据。 The problem is, in order to see what I have all I know to do is save it out to a savedlist and then read through the savedlist file I created.
问题是,为了查看我所要做的全部工作,是将其保存到保存列表中,然后通读我创建的保存列表文件。
Is there a way to see the contents of a select without running it against a file? 有没有办法查看选择内容而不对文件运行它?
If you are just wanted to visually look over the data, use LIST
instead of SELECT
. 如果只想直观地查看数据,请使用
LIST
而不是SELECT
。
The general syntax of the command is something like: 该命令的一般语法如下:
LIST filename WITH [criteria] [sort] [attributes | ALL]
So let's say you have a table called questions
and want to look over all the author
for questions that used the tag unidata
. 因此,假设您有一个名为
questions
的表,并且希望查看所有author
以查找使用标记unidata
。 Your query might look something like: 您的查询可能类似于:
LIST questions WITH tag = "unidata" BY author author
Note: The second author isn't a mistake, it's the start of the list of attributes you want displayed - in this case just author, but you might want the record id as well, so you could do @ID author
instead. 注意:第二个作者不是一个错误,它是您要显示的属性列表的开始-在这种情况下,仅是作者,但您可能还需要记录ID,因此您可以使用
@ID author
。 Or just do ALL
to display everything in each record. 或者只是执行
ALL
以显示每个记录中的所有内容。
I did BY author
here as it will make spotting uniques easier, but you can also use other query features like BREAK.ON
to help here as well. 我在这里做了
BY author
,因为它可以使发现唯一性更加容易,但是您也可以使用BREAK.ON
等其他查询功能在此处提供帮助。
I don't know why I didn't think of it at the time but I basically needed something like SQL's DISTINCT statement since I just needed to view the unique values. 我不知道为什么当时我没有想到它,但是我基本上需要像SQL的DISTINCT语句那样的东西,因为我只需要查看唯一值。 Replicating DISTINCT in UniData is explained here, https://forum.precisonline.com/index.php?topic=318.0 .
在https://forum.precisonline.com/index.php?topic=318.0中解释了在UniData中复制DISTINCT的情况。
The trick is to sort on the values using BY
, get a single unique value of each using BREAK-ON
, and then suppress everything except those unique values using DET-SUP
. 诀窍是使用
BY
对值进行排序,使用BREAK-ON
获得每个值的唯一值,然后使用DET-SUP
抑制除那些唯一值以外的所有值。
LIST BUILDINGS BY CITY BREAK-ON CITY DET-SUP
CITY.............
Albuquerque
Arlington
Ashland
Clinton
Franklin
Greenville
Madison
Milton
Springfield
Washington
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.