早教吧作业答案频道 -->其他-->
异常TooManyResultsException:Expectedoneresult(ornull)tobereturnedbyselectOne(),butfound:2SELECTID,LOCATORID,DATEFORMAT(DATE,'%H:%i:%S')ASDATE,CAST(TYPEASCHAR)ASTYPEFROMTRAILWHERECODE=#{minerCode,jdbcType=INTEGER}ANDDATEBETWE
题目详情
异常TooManyResultsException:Expected one result(or null) to be returned by selectOne(),but found:2
SELECT ID,LOCATORID,DATE_FORMAT(DATE,'%H:%i:%S') AS DATE,CAST(TYPE AS CHAR) AS TYPE
FROM TRAIL
WHERE CODE = #{minerCode,jdbcType=INTEGER}
AND DATE BETWEEN
STR_TO_DATE(DATE_FORMAT(#{date},'%Y-%m-%d %H:%i:%S'),'%Y-%m-%d %H:%i:%S')
AND date_add(date_add(STR_TO_DATE(DATE_FORMAT(#{date},'%Y-%m-%d %H:%i:%S'),'%Y-%m-%d %H:%i:%S'),interval 1 day),interval -1 second)
SELECT ID,LOCATORID,DATE_FORMAT(DATE,'%H:%i:%S') AS DATE,CAST(TYPE AS CHAR) AS TYPE
FROM TRAIL
WHERE CODE = #{minerCode,jdbcType=INTEGER}
AND DATE BETWEEN
STR_TO_DATE(DATE_FORMAT(#{date},'%Y-%m-%d %H:%i:%S'),'%Y-%m-%d %H:%i:%S')
AND date_add(date_add(STR_TO_DATE(DATE_FORMAT(#{date},'%Y-%m-%d %H:%i:%S'),'%Y-%m-%d %H:%i:%S'),interval 1 day),interval -1 second)
▼优质解答
答案和解析
你希望返回一行,但实际select得到的,超过一行记录.
先查清楚WHERE条件,确定是返回一行的情况,再用selectOne
先查清楚WHERE条件,确定是返回一行的情况,再用selectOne
看了异常TooManyResult...的网友还看了以下:
物理电学问题,求解答答案(1)Q=q(2)R<r:E=q/(4πεr*r):R>=r:E=qr*r/ 2020-03-31 …
急救!若a>0,b>0,且a+b=c.求证:(1)当r>1时a^r+b^r<c^r;(2)当r<1 2020-04-05 …
设A为n阶矩阵,证明:R(A+I)+R(A-I)>=n已知R(A)=R(kA),k≠0;R(A+B 2020-05-14 …
设向量组α1,α2,…αr线性无关,证明向量组β1=α1+αr,β2=α2+αr,…,βr=αr- 2020-05-16 …
E^2*R/(R+r)^2=E^2/(R-r)^2/R+4r(某公式推导最后两行)本人只得:=E^ 2020-06-07 …
请问这个怎么判断是否有最大值或者最小值?S(r)=2πr²+2V/r(r>0)这个S(r)的最值怎 2020-06-15 …
2009年元旦晚会上,八(13)班数学老师出了一道抢答题已知圆环的半径和与半径差分别为abπab因 2020-07-10 …
证明:▽(1/R)=-r/R^3r是静电场位置矢量,R是r的模.证明:▽^2(1/│r-r'│)= 2020-07-29 …
什么是二项式的通式?在二项式定理(a+b)^n=C(n,0)a^n+C(n,1)a^(n-1)b+ 2020-07-31 …
异常TooManyResultsException:Expectedoneresult(ornull 2020-10-29 …