交叉选项卡查询/使用数据透视或任何我想要显示名称作为行明智和连续日期作为列 [英] Cross Tab Query/ Using Pivot Or Anything I Want To Display Names As Row Wise And Consecutive Dates As Columns
问题描述
我在考勤时被困在一个地方。 VB。
GUYS可以建议我查询以下内容。 没有商店程序请
我的sql数据库中有一张表。
2列,名称和约会。
NAMES |日期
abc 1-1-2014
abc 2-1-2014
cde 2-1- 2014
cde 3-1-2014
efg 3-1-2014
hij 4-1-2014
i想要一个查询,以便我可以在GRID中显示这些信息。
NAMES 1-1-2014 || 2-1-2014 || 3-1-2014 || 4-1-2014
abc是是否否
cde否是是否
efg否否是的是
hij no no no yes
你们可以吗?告诉我这个真实的问题。我会通过编码来做自己/不通过自己的部分。
我不擅长数据库。谢谢你。
I got stuck at a place while making attendance application. VB.
GUYS CAN SUGGEST ME QUERY FOR FOLLOWING . NO STORE PROCEDURE PLEASE,
I have a table in my sql database.
2 columns , name and dates.
NAMES | DATES
abc 1-1-2014
abc 2-1-2014
cde 2-1-2014
cde 3-1-2014
efg 3-1-2014
hij 4-1-2014
i want a query so that i can show this information in GRID.
NAMES 1-1-2014 || 2-1-2014 || 3-1-2014 || 4-1-2014
abc yes yes no no
cde no yes yes no
efg no no yes yes
hij no no no yes
Can u guys show me the EXACT QUERY FOR THIS. I WILL DO THE YES/NO PART BY MYSELF through coding.
i am not much good at database. Thank u .
推荐答案
如果你不想使用 SQL pivot [ ^ ],我建议使用 Linq [ ^ ]。
LINQ Pivot,或交叉表,扩展方法 [ ^ ]
LinQ到实体的数据透视表 [ ^ ]
是否可以使用LINQ旋转数据? [ ^ ]
If you don't want use SQL pivot[^], i'd suggest to use Linq[^].
LINQ Pivot, or Crosstab, Extension Method[^]
Pivot table in LinQ to entity[^]
Is it possible to Pivot data using LINQ?[^]
这篇关于交叉选项卡查询/使用数据透视或任何我想要显示名称作为行明智和连续日期作为列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!