当前位置: 首页 > news >正文

sqlserver

SELECT T1.* FROM (SELECT 未来之窗.*, ROW_NUMBER() OVER ( ORDER BY rand()) AS ROW_NUMBER FROM (SELECT count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj FROM emp_performance WHERE ( (CreateDate BETWEEN '2024-09-04 00:00:00' AND '2024-11-04 23:59:59' ) ) AND ( EmployeePost = '0001' ) AND ( EmpCode = '006' ) AND ( ItemClass = '00000001' ) AND ( Specify = 0 )) AS 未来之窗) AS T1 WHERE (T1.ROW_NUMBER BETWEEN 1 AND 1)


1> SELECT T1.* FROM (SELECT thinkphp.*, ROW_NUMBER() OVER ( ORDER BY rand()) AS ROW_NUMBER FROM (SELECT EmpCode,EmpName,count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj FROM emp_performance WHERE ( (CreateDate BETWEEN '2024-09-04 00:00:00' AND '2024-11-04 23:59:59' ) ) AND ( EmployeePost = '0001' ) AND ( MemCode = 'notnull' ) GROUP BY EmpCode) AS thinkphp) AS T1
2> go
42000 - [SQL Server]选择列表中的列 'emp_performance.EmpName' 无效,因为该列没有包含在聚合函数或 GROUP BY 子句中。
1> SELECT T1.* FROM (SELECT thinkphp.*, ROW_NUMBER() OVER ( ORDER BY rand()) AS ROW_NUMBER FROM (SELECT EmpCode,EmpName,count(Name) order_count,sum(NowPrice) yye,sum(EmpAchieve) yj FROM emp_performance WHERE ( (CreateDate BETWEEN '2024-09-04 00:00:00' AND '2024-11-04 23:59:59' ) ) AND ( EmployeePost = '0001' ) AND ( GuestSex = '女客' ) GROUP BY EmpCode,EmpName) AS thinkphp) AS T1
2> go
+---------+----------+-------------+--------+----------+------------+
| EmpCode | EmpName  | order_count | yye    | yj       | ROW_NUMBER |
+---------+----------+-------------+--------+----------+------------+
| 01      | 吕柯     |          55 | 14083  | 11229.85 |          1 |
| 03      | 力波     |          11 | 1292   | 1069.15  |          2 |
| 05      | 小峰     |          30 | 5140.8 | 4351.86  |          3 |
| 06      | 六小龄童 |          11 | 744    | 653.6    |          4 |
| 201     | 另一     |          37 | 4778   | 4076.55  |          5 |
+---------+----------+-------------+--------+----------+------------+
(5 rows affected)
 


http://www.mrgr.cn/news/65857.html

相关文章:

  • [spring源码]spring推断构造方法
  • Oracle OCP认证考试考点详解082系列11
  • ubuntu常用基本指令简记
  • vue3-ref 和 reactive
  • 地理信息科学专业想搞GIS开发:学前端还是后端?
  • mockito+junit完成单元测试
  • 【C++ 曼哈顿距离 数学】1131. 绝对值表达式的最大值|2059
  • 模块功能的描述方法
  • 理解数据加载器(Data Loader)
  • OSI参考模型
  • Java 8的关键新特性:JDK加解密、Lambda表达式、日期时间API及Optional类
  • Vue全栈开发旅游网项目(6)-接口开发
  • Java 基本数据类型 和 输入输出语句
  • 【编程语言】Kotlin快速入门 - 泛型
  • 全面解析:云计算技术及其应用
  • 【Linux 27】HTTP 协议中的 cookie 和 session
  • C++算法练习-day34——257.二叉树的所有路径
  • MATLAB实现图像恢复设计报告
  • 掌握 In-Context Learning (ICL):构建高效 Prompt 的技巧与调优策略
  • Java | Leetcode Java题解之第539题最小时间差
  • 使用QtWebEngine的Mac应用如何发布App Store
  • 文件操作和 IO(二):文件内容操作 => 流对象
  • 小北的字节跳动青训营与LangChain实战课:深入解析模型I/O与提示模板(持续更新中~~~)
  • Java 入门
  • DFS求解迷宫最长移动路线
  • 助力风力发电风机设备智能化巡检,基于YOLOv8全系列【n/s/m/l/x】参数模型开发构建无人机巡检场景下风机叶片缺陷问题智能化检测预警模型