返回具有每列多个条目的条目。

huangapple go评论46阅读模式
英文:

How to return entries that have more than one entry per column

问题

让我们假设我有一个这样的表格:

客户 地址
约翰 地址 1
乔尔 地址 1, 地址 2
莎拉 地址 3, 地址 4

我想要返回一个这样的表格:

客户 地址
乔尔 地址 1, 地址 2
莎拉 地址 3, 地址 4

我应该如何做到这一点?

我不知道要使用哪些语句。

英文:

Let's say I have a table like this:

Client Address
John Address 1
Joel Address 1, Address 2
Sarah Address 3, Address 4

And I want to return a table like this:

Client Address
Joel Address 1, Address 2
Sarah Address 3, Address 4

How would I do that?

I don't know which statements to use

答案1

得分: 1

以下是要翻译的内容:

首先,当决定如何对数据进行筛选时,您总是希望找到一个可用于创建筛选条件的识别因素。

对于您的示例数据,一个识别因素是仅存在于具有两个地址的条目中的逗号。因此,适用于您的示例数据的筛选条件是:

WHERE Address LIKE '%,%'
英文:

The first thing you always want to do when deciding how to filter on data is find an identifying factor that you can leverage to create said filter.

For your example data, an identifying factor is the comma that only exists in entries with two addresses. So a filter that would work on your example data is:

WHERE Address LIKE '%,%'

huangapple
  • 本文由 发表于 2023年6月5日 22:28:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407453.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定