使用什么条件 [英] What condition to use
本文介绍了使用什么条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!
我有这样的sql结果:
| parktype | areaid |总|
| -------- | ------ | ----- |
| 2 | A | 100 |
| 3 | A | 200 |
| 2 | B | 300 |
| 3 | B | 400 |
我希望它在c#中显示如下内容:
A
2:P 100
3:P 200
B
2:P 300
3:P 400
感谢您的帮助。
解决方案
例如,请参阅 PIVOT
表中的此Stack Overflow问题: MySQL数据透视表 [ ^ ]。
如果你想在SQL服务器中自定义它,那么使用PIVOT表,如果你想在C#中自定义它,编写你自己的代码逻辑,如果你在任何地方重新回到我们。
Hi!
I have a sql result like this:
|parktype|areaid|total|
|--------|------|-----|
| 2 | A | 100 |
| 3 | A | 200 |
| 2 | B | 300 |
| 3 | B | 400 |
And I want it to display something like this in c#:
A
2: P 100
3: P 200
B
2: P 300
3: P 400
Thank you for the help.
解决方案
See, for instance, this Stack Overflow question on PIVOT
tables: MySQL pivot table[^].
If you want to customize it in SQL server then use PIVOT Table, if you want to customize the same in C#, wrote your own code logic, if you struck in any place revert back to us.
这篇关于使用什么条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文