小编全雨秋*_*全雨秋的帖子

EF Core 2.1 中的 COUNT(DISTINCT *)

SELECT
  e.EmpName,
  me.RemarkNumber,
  me.RemarkPeopleNumber
FROM
  EmployeeInfo e
  LEFT JOIN (
    SELECT
      COUNT(RemarkId) As RemarkNumber,
      COUNT(DISTINCT MemberId) As RemarkPeopleNumber,
      CreateUser
    FROM
      MemberRemark
    WHERE
      RemarkStatus = 0
    GROUP BY
      CreateUser
  ) AS me On e.EmpName = me.CreateUser
WHERE
  BranchCode = '0000'
  And [Status] = 0
Run Code Online (Sandbox Code Playgroud)

如何将其转换为 LINQ?

from e in db.EmployeeInfo
join me in (
    from memberRemarks in db.MemberRemark
    where memberRemarks.RemarkStatus == 0
    group memberRemarks by new
    {
        memberRemarks.CreateUser,
    } into g
    select new
    {
        RemarkNumber = g.Count(),
        RemarkPeopleNumber = g.Select(m => …
Run Code Online (Sandbox Code Playgroud)

c# linq asp.net-core-2.1 ef-core-2.1

5
推荐指数
1
解决办法
1656
查看次数

循环视图路径 [index.jsp]:将再次分派回当前处理程序 URL [/index.jsp]

这是我的项目

\n\n

在此输入图像描述

\n\n

这是我的 spring-mvc.xml

\n\n
<?xml version="1.0" encoding="UTF-8"?>\n<beans xmlns="http://www.springframework.org/schema/beans"\n   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n   xmlns:context="http://www.springframework.org/schema/context"\n   xmlns:mvc="http://www.springframework.org/schema/mvc"\n   xsi:schemaLocation="\n        http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd\n        http://www.springframework.org/schema/context   http://www.springframework.org/schema/context/spring-context-4.1.xsd\n        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">\n    <context:component-scan base-package="com.SpringDemo.Controller"/>\n <!-- Thymeleaf Template Resolver -->\n    <bean id="templateResolver" class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">\n      <property name="prefix" value="" />\n      <property name="suffix" value=".html" />\n      <property name="templateMode" value="HTML" />\n      <property name="order" value="1" />\n    </bean>\n\n    <bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">\n      <property name="templateResolver" ref="templateResolver" />\n      <property name="enableSpringELCompiler" value="true" />\n    </bean>\n\n  <bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">\n      <property name="viewNames" value="thymeleaf/*"/>\n      <property name="templateEngine" ref="templateEngine" />\n  </bean>\n\n  <!-- \xe5\xaf\xb9\xe6\xa8\xa1\xe5\x9e\x8b\xe8\xa7\x86\xe5\x9b\xbe\xe5\x90\x8d\xe7\xa7\xb0\xe7\x9a\x84\xe8\xa7\xa3\xe6\x9e\x90\xef\xbc\x8c\xe5\x8d\xb3\xe5\x9c\xa8\xe6\xa8\xa1\xe5\x9e\x8b\xe8\xa7\x86\xe5\x9b\xbe\xe5\x90\x8d\xe7\xa7\xb0\xe6\xb7\xbb\xe5\x8a\xa0\xe5\x89\x8d\xe5\x90\x8e\xe7\xbc\x80 -->\n  <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">\n      <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />\n\n      <property …
Run Code Online (Sandbox Code Playgroud)

spring-mvc

1
推荐指数
1
解决办法
6784
查看次数

标签 统计

asp.net-core-2.1 ×1

c# ×1

ef-core-2.1 ×1

linq ×1

spring-mvc ×1