从sql,Group和Assign获取数据到数组 [英] Get data from sql, Group, and Assign to array
本文介绍了从sql,Group和Assign获取数据到数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Original Query:
Jan-01 | {"Barako", "Cappuccino", "Latte"}
Jan-02 | {"Barako", "White Coffee", "3 in 1 Orignal"}
and then I have grouped them and insert into array
- Cappuccino
- Latte
- 3 in 1 Original
- White Coffee
- Barako
{"Cappuccino", "Latte", "3in1Orginial", "WhiteCoffee", "Barako"}
Now I want to re-assign them back to their designated arrays.
ex.
Jan-01 | {"Barako", "Cappuccino", "Latte"}
Jan-02 | {"Barako", "White Coffee", "3 in 1 Orignal"}
< br $> b $ b
我应该在我的c#课程中使用什么
我必须联系他们吗?或者是什么?
推荐答案
根据你所拥有的,你无法知道个人价值是什么。我将它存储为字典,在C#中将日期时间映射到字符串列表。在一百万年里,我绝不会将Barako,卡布奇诺,拿铁作为单一的不同价值存储到数据库中。暗示这就是你正在做的事情,你不应该,如果这是真的。
我认为需要更多解释。
可以肯定的是,你已经抛弃了细节,而你无法取回它们,它们就不见了。
There's no way, from what you have, to know what the individual values were. I would store this as a dictionary, with a datetime mapping to a list of strings, in C#. I would never, in a million years, store "Barako", "Cappuccino", "Latte" as a single distinct value in to a database. It is implied that this is what you're doing, and you shouldn't, if that is true.
I think some more explanation is needed.
What is for sure is that you've thrown away details, and you can't get them back, they are gone.
这篇关于从sql,Group和Assign获取数据到数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文