在同一表中扩展列值
我有以下数据表,其中wid和parentID是同一列的值,但彼此相关。此处显示的状态是针对WID的,我想将另一列作为parentidState扩展为parentidstate,该列应该是parentid的状态。 (状态的价值也存在于同一表中)。我该怎么办?
datatable(WId:int, WType:string, Link:string, ParentId:dynamic, State:string)
[
374075, "Deliverable", "Link", dynamic(315968), "Started",
]
进一步更新以进行澄清 -
datatable(WId:int, WType:string, Link:string, ParentId:dynamic, State:string)
[
374075, "Deliverable", "Link", dynamic(315968), "Started",
315968, "Parent", "Link", dynamic(467145), "Planned"
]
parentid是动态的,因为它是从JSON中提取的。在上面的数据表中,parentID实际上是WID的值,并且具有相关的详细信息。我的目的是扩展我的表格,以在下面的另一列中给出父态
。
I have the below datatable, where WId and ParentId are values of the same column but are related to each other. The State that's shown here is for WId, I want to extend another column as ParentIdState which should be the State of ParentId. (The value of State also exists in the same table). How can I do so?
datatable(WId:int, WType:string, Link:string, ParentId:dynamic, State:string)
[
374075, "Deliverable", "Link", dynamic(315968), "Started",
]
Updating further for clarification -
datatable(WId:int, WType:string, Link:string, ParentId:dynamic, State:string)
[
374075, "Deliverable", "Link", dynamic(315968), "Started",
315968, "Parent", "Link", dynamic(467145), "Planned"
]
ParentId is dynamic because it's extracted from a JSON. In the above datatable ParentId is actually a value of WId and has its relevant details. My intent is to extend my table to give ParentState in another column like below -
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该使用 /a>或 。
You should use
join
orlookup
.我相信您可以
join
2 个表:ParentId
的类型从dynamic
更改为int
(与WId
的类型相同,因为将对其执行连接)。WId
和State
这里可能需要进行一些优化(例如通过使用 materialize,但我不完全确定)
你也可以实现与
查找
I believe you could
join
2 tables:ParentId
is changed fromdynamic
toint
(the same as the type ofWId
as the join will be performed on it).WId
andState
There might be some optimization to be done here (for example by using materialize, but I'm not entirely sure)
You can also achieve the same with
lookup