gpt4 book ai didi

mysql - HQL:子查询返回多于1行

转载 作者:行者123 更新时间:2023-11-30 00:11:45 25 4
gpt4 key购买 nike

我是 HQL 新手,需要有关此错误的帮助。

查询:

 String hqlsearchSelect =
"select new com.eteligent.core.loans.paging.LoansAppCustomerPageItem("
+ "main.loanno, (SELECT acct.id.clientid FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno), (SELECT acct.name FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno), main.acctsts, "
+ "main.loanbal, (SELECT acct.matdt FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno) )";

我认为查询无法识别它将返回哪条记录。

构造函数(LoansAppCustomerPageItem):

public LoansAppCustomerPageItem( final String acctNo, final String cifNo, final String customerName, final Integer acctStat, final BigDecimal acctBal, final Date acctDueDate )
{
super();
this.acctNo = acctNo;
this.cifNo = cifNo;
this.customerName = customerName;
this.acctStat = acctStat;
this.acctBal = acctBal;
this.acctDueDate = acctDueDate;
}

最佳答案

如果您只想子查询中的一行,请在子查询末尾使用LIMIT 1

关于mysql - HQL:子查询返回多于1行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23986695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com