我有一张这样的桌子:
Employee Month ActDate
Emp 1 Feb 10/02/2019
Emp 1 Feb 15/02/2019
Emp 1 Mar 10/03/2019
Emp 2 Mar 09/03/2019
Emp 2 Apr 04/04/2019
Emp 2 Apr 05/04/2019
Emp 3 Feb 03/02/2019
Emp 4 Feb 06/02/2019
我需要使它看起来像这样
Employee Feb Mar Apr
Emp 1 10/02/2019 - 15/02/2019 10/03/2019
Emp 2 09/03/2019 04/04/2019 - 05/04/2019
Emp 3 03/02/2019
Emp 4 06/02/2019
我可以解决这个问题,但是例如Emp2在2月会有2行,我需要将同一位员工的所有行连接起来,我该如何实现呢?
使用SQL Server 2008
谢谢
答案 0 :(得分:2)
这是带有某些条件逻辑的聚合。这可能是最简单的两种聚合级别:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.RequiresPointer = RequiresPointer.Never;
Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
bool res = daWebView.Focus(FocusState.Unfocused);
daWebView.GettingFocus += DaWebView_GettingFocus;
daWebView.PointerMoved += DaWebView_PointerMoved;
Uri uri = new Uri("ms-appx-web:///index.html");
daWebView.Source = uri;
}
private void DaWebView_PointerMoved(object sender, PointerRoutedEventArgs e)
{
// never happens.
Debug.WriteLine("pointer moved");
}
private void DaWebView_GettingFocus(UIElement sender, GettingFocusEventArgs args)
{
// not working, it still gets focus and receive mouse movement.
args.Cancel = true;
}
}