当前位置: 首页 > 知识库问答 >
问题:

H2数据库/SpringBoot SQL错误:42122,SQLState:42S22(未找到列)

祁博涛
2023-03-14

我的spring boot应用程序中的查询有问题。

我有一个由这个Pojo定义的表

import java.time.LocalDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;

@Table(name = "atm_cash_pickup", uniqueConstraints = {
        @UniqueConstraint(columnNames = { "atm_identifier", "expected_pickup" }) })
@Entity
public class AtmCashPickup {

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    private Integer id;

    @NotNull
    @Column(name = "atm_identifier")
    private String atmIdentifier;

    @NotNull
    @Column(name = "expected_pickup")
    private LocalDate expectedPickup;

    @Column(name = "actual_pickup")
    private LocalDate actualPickup;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAtmIdentifier() {
        return atmIdentifier;
    }

    public void setAtmIdentifier(String atmIdentifier) {
        this.atmIdentifier = atmIdentifier;
    }

    public LocalDate getExpectedPickup() {
        return expectedPickup;
    }

    public void setExpectedPickup(LocalDate expectedPickup) {
        this.expectedPickup = expectedPickup;
    }

    public LocalDate getActualPickup() {
        return actualPickup;
    }

    public void setActualPickup(LocalDate actualPickup) {
        this.actualPickup = actualPickup;
    }
}

我的CRUD存储库正在使用此表检索一组值

@Repository
public interface CashPickupRepository extends CrudRepository<AtmCashPickup, Integer> {

    @Query(
            value = "select atm_identifier atm, min(expected_pickup) start_date, max(actual_pickup) end_date\n" +
                    "from (select atm_cash_pickup.*,\n" +
                    "             count(actual_pickup) over (partition by atm_identifier order by expected_pickup desc) as grp\n" +
                    "      from atm_cash_pickup\n" +
                    "     ) atm_cash_pickup\n" +
                    "group by atm_identifier, grp;",
            nativeQuery = true)
    List<AtmCashPickup> findAtmCashPickupNonNullRanges();

}

这是我的SQL查询,当我将其与MySQL一起使用并返回预期值时,它运行良好。不幸的是,当我将其用于我的应用程序/控制器时,我得到了一个与“id”字段相关的错误。

下面是错误堆栈

2021-07-22 07:51:08.541 DEBUG 18913 --- [nio-7775-exec-1] org.hibernate.SQL                        : select atm_identifier atm, min(expected_pickup) start_date, max(actual_pickup) end_date
from (select atm_cash_pickup.*,
             count(actual_pickup) over (partition by atm_identifier order by expected_pickup desc) as grp
      from atm_cash_pickup
     ) atm_cash_pickup
group by atm_identifier, grp;
2021-07-22 07:51:08.552  WARN 18913 --- [nio-7775-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 42122, SQLState: 42S22
2021-07-22 07:51:08.553 ERROR 18913 --- [nio-7775-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : Column "id" not found [42122-200]
2021-07-22 07:51:08.559 DEBUG 18913 --- [nio-7775-exec-1] o.s.web.servlet.DispatcherServlet        : Failed to complete request: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select atm_identifier atm, min(expected_pickup) start_date, max(actual_pickup) end_date
from (select atm_cash_pickup.*,
             count(actual_pickup) over (partition by atm_identifier order by expected_pickup desc) as grp
      from atm_cash_pickup
     ) atm_cash_pickup
group by atm_identifier, grp;]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
2021-07-22 07:51:08.563 ERROR 18913 --- [nio-7775-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select atm_identifier atm, min(expected_pickup) start_date, max(actual_pickup) end_date
from (select atm_cash_pickup.*,
             count(actual_pickup) over (partition by atm_identifier order by expected_pickup desc) as grp
      from atm_cash_pickup
     ) atm_cash_pickup
group by atm_identifier, grp;]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query] with root cause

org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "id" not found [42122-200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:453) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.jdbc.JdbcResultSet.getColumnIndex(JdbcResultSet.java:3169) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.jdbc.JdbcResultSet.get(JdbcResultSet.java:3268) ~[h2-1.4.200.jar:1.4.200]
    at org.h2.jdbc.JdbcResultSet.getInt(JdbcResultSet.java:352) ~[h2-1.4.200.jar:1.4.200]
    at com.zaxxer.hikari.pool.HikariProxyResultSet.getInt(HikariProxyResultSet.java) ~[HikariCP-3.4.2.jar:na]
    at org.hibernate.type.descriptor.sql.IntegerTypeDescriptor$2.doExtract(IntegerTypeDescriptor.java:62) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:47) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:243) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:329) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:808) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:732) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.processResultSet(Loader.java:1008) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.doQuery(Loader.java:964) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2838) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.doList(Loader.java:2820) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2652) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.Loader.list(Loader.java:2647) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:2131) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.internal.AbstractSharedSessionContract.list(AbstractSharedSessionContract.java:1163) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.query.internal.NativeQueryImpl.doList(NativeQueryImpl.java:173) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1530) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.hibernate.query.Query.getResultList(Query.java:165) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:126) ~[spring-data-jpa-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:88) ~[spring-data-jpa-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:154) ~[spring-data-jpa-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:142) ~[spring-data-jpa-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:618) ~[spring-data-commons-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:605) ~[spring-data-commons-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) ~[spring-tx-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) ~[spring-tx-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:149) ~[spring-data-jpa-2.2.6.RELEASE.jar:2.2.6.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at com.sun.proxy.$Proxy95.findAtmCashPickupNonNullRanges(Unknown Source) ~[na:na]
    at com.localcoin.bdeval.service.CashPickUpService.findAtmCashPickupNonNullRanges(CashPickUpService.java:17) ~[classes/:na]
    at com.localcoin.bdeval.controller.BDController.searchRangesRaw(BDController.java:34) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.5.RELEASE.jar:5.2.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1594) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.33.jar:9.0.33]
    at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]

2021-07-22 07:51:08.567 DEBUG 18913 --- [nio-7775-exec-1] o.s.web.servlet.DispatcherServlet        : "ERROR" dispatch for GET "/error", parameters={}
2021-07-22 07:51:08.569 DEBUG 18913 --- [nio-7775-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2021-07-22 07:51:08.577 DEBUG 18913 --- [nio-7775-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2021-07-22 07:51:08.579 DEBUG 18913 --- [nio-7775-exec-1] o.s.web.servlet.DispatcherServlet        : Exiting from "ERROR" dispatch, status 500

任何人都可以帮我弄明白为什么我会得到这个

2021-07-22 07:51:08.552WARN 18913---[nio-7775-exec-1]o.h.engine.jdbc.spi.SqlExceptionHelper:SQL错误: 42122, SQLState: 42S22 2021-07-22 07:51:08.553错误18913---[nio-7775-exec-1]o.h.engine.jdbc.spi.SqlExceptionHelper:未找到列id[42122-200]

我有一种感觉,我的H2查询需要一种语法,但这是我第一次使用H2 DB,我的常用引擎MySql一切正常。

非常感谢您的帮助!

共有1个答案

宋景福
2023-03-14

您需要将id添加到您的查询中,因为AtmCashPickup实体需要id字段:

@Repository
public interface CashPickupRepository extends CrudRepository<AtmCashPickup, Integer> {

    @Query(
            value = "select id, atm_identifier atm, min(expected_pickup) start_date, max(actual_pickup) end_date\n" +
                    "from (select atm_cash_pickup.*,\n" +
                    "             count(actual_pickup) over (partition by atm_identifier order by expected_pickup desc) as grp\n" +
                    "      from atm_cash_pickup\n" +
                    "     ) atm_cash_pickup\n" +
                    "group by atm_identifier, grp;",
            nativeQuery = true)
    List<AtmCashPickup> findAtmCashPickupNonNullRanges();

}
 类似资料:
  • 我有查询异常SQLSTATE[42S22]:列未找到: 1054 Champ'3'在子句(SQL:选择,,从内连接

  • 我使用的框架Laravel。 我有两个表(用户和成员)。当我想登录时,我会收到错误消息: SQLSTATE[42S22]:找不到列: 1054未知的列'user_email'in'where子句'(SQL:选择*fromwhere=?限制1)(绑定:数组(0= 表用户 表成员 迁移用户 移民成员 模型用户 模范会员 成员模型使用:使用照明\Auth\UserInterface; 控制器 auth.

  • 我是编程界的新手,我自己在学习laravel,我发现了这个错误:SQLSTATE[42S22]:Column not found:1054未知列'clientes.clientes\u id'在'where子句中(SQL:select*fromwhere=1和不为空)(视图:/shared/httpd/laravel_8_crud/resources/views/pedidos/index.bla

  • 此函数有问题。它应该返回使用下面的sql调用收集的数据的json字符串。问题是,当通过服务器访问页面时(例如-localhost/app/API/states/Alabama/1/10.json),我得到一个错误代码“500”。奇怪的是,数据在使用.json和不使用appending.json的情况下按预期显示。据我所知,控制器和模型设置得很好,但错误代码仍然存在: {“code”:500,“ur

  • 我的代码:数据库中的值未更新,出现以下错误: (照明\数据库\查询异常(42S22)SQLSTATE[42S22]:找不到列: 1054未知列'用户名'在'where子句'(SQL:选择计数()作为聚合从其中=anikatabassum))和("SQLSTATE[42S22]:找不到列: 1054未知列'用户名'在'where子句'(SQL:选择计数()作为聚合从其中=anikatabassum)

  • 我正在尝试使用PDO向MySQL插入一条记录,下面的代码中可以看到我的sql语句。 当执行此代码时,我会遇到以下错误消息; SQLState[42S22]:找不到列:1054“Field List”中的未知列“John” 这无疑是解决这个问题的一个简单方法,但我似乎看不出来,有人能给我指明正确的方向吗?