SQL错误Duplicate column name 'NAME'名字重复应使用别名

<select id="getCurrentAndInformation" resultType="StudentCurrent">SELECTa.name AS "studentinf.name",a.gender AS "studentinf.gender",a.departmentname AS "studentinf.departmentname",a.roomnumber AS "studentinf.roomnumber",a.major AS "studentinf.major",a.bottomphoto AS "studentinf.bottomphoto",a.grade AS "studentinf.grade",a.dormitoryname AS "studentinf.dormitoryname",<include refid="studentCurrentColumns"/>FROM huigou_student_information aleft  join(SELECT *,max(uploadTime) as uploadTime   from huigou_student_current WHERE del_flag="0" GROUP BY studentInformationId)  sc on a.studentid=sc.studentinformationidWHERE a.studentid = #{studentid}
</select>

修改:

<select id="getCurrentAndInformation" resultType="StudentCurrent">SELECTa.name AS "studentinf.name",a.gender AS "studentinf.gender",a.departmentname AS "studentinf.departmentname",a.roomnumber AS "studentinf.roomnumber",a.major AS "studentinf.major",a.bottomphoto AS "studentinf.bottomphoto",a.grade AS "studentinf.grade",a.dormitoryname AS "studentinf.dormitoryname",<include refid="studentCurrentColumns"/>FROM huigou_student_information aleft  join(SELECT *,max(uploadTime) as uploadTime1   from huigou_student_current WHERE del_flag="0" GROUP BY studentInformationId)  sc on a.studentid=sc.studentinformationidWHERE a.studentid = #{studentid}
</select>

SQL错误Duplicate column name 'NAME'名字重复应使用别名相关推荐

  1. Java java.sql.SQLSyntaxErrorException:Duplicate column name ‘xxx‘问题解决

    问题描述: java.sql.SQLSyntaxErrorException: Duplicate column name 'username'; bad SQL grammar []; 问题分析: ...

  2. duplicate column name

    在建数据库表的字段时,duplicate column name是因为有重复列,删除一个或者改个别的名字就可以了

  3. 解决 duplicate column name

    duplicate column name ,列名重复. 原因: 1.有重复的列 解决: 1.删除其中一个列

  4. Navicat 筛选或插入某个字段出现1060 - Duplicate column name ‘XXX‘错误,以及导入sql文件时数据丢失问题。

    在mysql中,多个表联合查询或添加某个字段时,出现错误:[Err] 1060 - Duplicate column name 'XXX',主要原因是表中存在重复字段造成的结果,分两种情况: (1)使 ...

  5. Duplicate column name错误办法

    mysql报错Duplicate column name错误怎么解决? 将重复的列名重命名即可.

  6. SQL Error: 957, SQLState: 42000 ORA-00957: duplicate column name

    1. PositionLinkage config <?xml version="1.0" encoding="utf-8"?> <!DOCT ...

  7. DB2 SQL错误查询 LOAD时报的日志特别好用

    DB2 开发常遇到一些错误,从网上找了一些资料,留查错使用 LOAD时报的日志特别好用,每一句日志都可以查到: DB2 UDB的AS/400 SQL编程 Negative SQLCODEs 负SQLC ...

  8. DB2 SQL错误查询

    DB2 开发常遇到一些错误,从网上找了一些资料,留查错使用 DB2 UDB的AS/400 SQL编程 Negative SQLCODEs 负SQLCODE# SQL0007 SQLCODE -07 S ...

  9. sql错误索引中丢失_收集,汇总和分析丢失SQL Server索引统计信息

    sql错误索引中丢失 描述 (Description) Indexing is key to efficient query execution. Determining what indexes a ...

最新文章

  1. 数据统计之月增用户统计
  2. 截取前四位字符串_Python的字符串切片
  3. python基础代码库-python基础知识和练习代码
  4. linux数据被删了怎么办
  5. 管理费用负数报不了怎么办_我的心脏血管堵了很久,大夫说打不开了,我可怎么办?...
  6. 过来人经验!聊聊前端工程师的职业规划
  7. 4/7 SELECT语句:过滤(组合WHERE子句)
  8. WPF圆角按钮与触发颜色变化
  9. 判定重大风险有哪几种_安全风险识别和评估的方法有哪些?
  10. eureka管理界面是多少_Eureka注册中心
  11. 荣耀青春30青春版能升鸿蒙,或是新一代拍照神器 荣耀30青春版今日发布
  12. windows下cuda10.0+cudnn的配置
  13. macOS应用程序打开时出现崩溃的情况,怎样处理?
  14. php中的常用魔术方法总结
  15. de4dot反混淆脱壳工具可使用的包
  16. 论5数字的价值定位和推销策略
  17. web scraper翻页功能的实现
  18. Tableau数据分析-Chapter13雷达图和凹凸图
  19. 拜托,面试请不要再问我 Spring Cloud Alibaba 底层原理
  20. matlab读取wav,播放wav,绘制语音波形图

热门文章

  1. .Net中加密解密相关知识
  2. ASP经典分页类(改良后的分页类主要是显示属性)
  3. python实现通讯录的增删改查_python实现数据库增删改查
  4. python html做界面_[Python]简单的HTML页面合并脚本
  5. P2P打洞原理(二十二)
  6. android audio 音量设置分析
  7. Android之GPU过度绘制与图形渲染优化
  8. python之__repr__
  9. 推荐一个完美的计算机科学的视频集
  10. java string对象创建_Java问题解析:到底创建了几个String对象