我想要一个SQL语句来获取具有最小值的行.
考虑一下这个表:
id game point
1 x 5
1 z 4
2 y 6
3 x 2
3 y 5
3 z 8
Run Code Online (Sandbox Code Playgroud)
如何选择列中具有最小值的ID point,按游戏分组?像这样:
id game point
1 z 4
2 y 5
3 x 2
Run Code Online (Sandbox Code Playgroud) 我已在 AzureAD 中使用“Azure DevOps”权限创建了我的应用程序。
下面是我从 Azure DevOps 获取项目列表的代码
using (HttpClient client = new HttpClient())
{
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, "https://login.microsoftonline.com/21d63aec-6502-4638-98f3-04587e69d53b/oauth2/v2.0/token");
requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Dictionary<String, String> form = new Dictionary<String, String>()
{
{ "grant_type", "client_credentials" },
{ "client_id", "ac313ad2...." },
{ "scope", "https://app.vssps.visualstudio.com/.default" },
{ "client_secret", "BX0RldhqL...." }
};
requestMessage.Content = new FormUrlEncodedContent(form);
HttpResponseMessage responseMessage = client.SendAsync(requestMessage).Result;
if (responseMessage.IsSuccessStatusCode)
{
String body = responseMessage.Content.ReadAsStringAsync().Result;
JsonConvert.PopulateObject(body, tokenModel);
}
}
using (ProjectHttpClient projectHttpClient = new ProjectHttpClient(new Uri("https://dev.azure.com/AlfabetChennaiDev"), new VssOAuthAccessTokenCredential(tokenModel.AccessToken)))
{
IEnumerable<TeamProjectReference> projects = …Run Code Online (Sandbox Code Playgroud) 我从java脚本获取日期,并希望通过执行c#代码存储在sql表中.
怎么做?
java脚本格式:星期一10月15日15:34:18 UTC + 0530 2012
mssql格式:2012-10-15 16:18:04.000
这是我的Xdocument:
<Response>
<city>
<CityName>xxx</CityName>
<CityId>1</CityId>
</city>
<city>
<CityName>yyy</CityName>
<CityId>2</CityId>
</city>
</Response>
Run Code Online (Sandbox Code Playgroud)
我如何将其存储在Dictionary(cityname,cityid):
Dictionary<string, string > dictionary;
Run Code Online (Sandbox Code Playgroud)