NutzCN Logo
问答 使用自定义SQL语句,查询的时候,默认将我所有大写字母转换成小写怎么办?
发布于 2334天前 作者 Nooft 4067 次浏览 复制 上一个帖子 下一个帖子
标签:
/*techer.current.eud*/
SELECT oeb.* FROM auth_user au
LEFT JOIN relation_school_leader rsl on au.unionid=rsl.leaderId
LEFT JOIN relation_education_school res on rsl.schoolId=res.schoolId
LEFT JOIN org_education_bureau oeb on res.educationId=oeb.unionid $condition;

异常如下:

18-08-02 09:39:21.098 DEBUG [http-nio-8006-exec-1] SELECT oeb.* FROM auth_user au
LEFT JOIN relation_school_leader rsl on au.unionid=rsl.leaderId
LEFT JOIN relation_education_school res on rsl.schoolId=res.schoolId
LEFT JOIN org_education_bureau oeb on res.educationId=oeb.unionid  WHERE au.username=?;
    |     1 |
    |-------|
    | liuer |
  For example:> "SELECT oeb.* FROM auth_user au
LEFT JOIN relation_school_leader rsl on au.unionid=rsl.leaderId
LEFT JOIN relation_education_school res on rsl.schoolId=res.schoolId
LEFT JOIN org_education_bureau oeb on res.educationId=oeb.unionid  WHERE au.username='liuer';"
18-08-02 09:39:21.099 DEBUG [http-nio-8006-exec-1] SQLException
org.postgresql.util.PSQLException: ERROR: column rsl.leaderid does not exist
  位置:83
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:118)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2830)
	at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeQuery(FilterEventAdapter.java:465)
	at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeQuery(FilterChainImpl.java:2827)
	at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeQuery(PreparedStatementProxyImpl.java:181)
	at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:228)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:272)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.integration.spring.SpringDaoRunner._run(SpringDaoRunner.java:18)
	at org.nutz.dao.impl.sql.run.NutDaoRunner$1.run(NutDaoRunner.java:75)
	at org.nutz.trans.Trans.exec(Trans.java:174)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:73)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
10 回复

不是提示了列不存在吗。

你没看我上面SQL语句么。。。

没看到sql里面有大写的字段名呀

SELECT oeb.* FROM auth_user au
LEFT JOIN relation_school_leader rsl on au.unionid=rsl.leaderId    <-----------------这儿

nutz没转换大小写的,那是pgsql的问题

PostgreSQL 你在字段名加上双引号试试。

添加回复
请先登陆
回到顶部