如何从结果中删除一行
假设我有此查询:
select item_display_name
from all_requirements
where state = 'submitted_pending' and id = 'mNAr9viL4='
这显示了两个结果/行:
'id proof'
'id proof'
因为
列中的一个值之一是不同的。all_requirements
lime
我希望查询仅返回ID证明
一次。我该怎么做?
Suppose I have this query:
select item_display_name
from all_requirements
where state = 'submitted_pending' and id = 'mNAr9viL4='
This displays two results/rows:
'id proof'
'id proof'
because one of the values in column document_id
of all_requirements
is different.
I want the query to only return id proof
once. How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为您的Select语句添加独特的使用,可与1列一起使用。
如果要包含document_id列或其他列,则可以使用以下代码返回每个唯一的item_display_name的记录。按ASC顺序排序的订单将为您提供具有最低文档的记录,但是您可以将其更改为DESC订单,以为您提供具有最高文档的记录。
Adding DISTINCT to your Select statement works with 1 column.
If you want to include the document_id column or other columns, then you can use the following code to return 1 record for each unique Item_Display_Name. The Order By statement sorted in ASC order will give you the record with the lowest document_ID, but you can change it to DESC order to give you the one record with the highest document_ID.