Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法支持常量结果,能看看怎么回事么? #1229

Open
AqooDer opened this issue Oct 17, 2023 · 2 comments
Open

无法支持常量结果,能看看怎么回事么? #1229

AqooDer opened this issue Oct 17, 2023 · 2 comments

Comments

@AqooDer
Copy link

AqooDer commented Oct 17, 2023

比如:select count(*) as totle,'全系统' as all_sys,1 as state from user where state in(1,8) .
报错如下:Caused by: org.nlpcn.es4sql.exception.SqlParseException: unknown field name : 1
at org.nlpcn.es4sql.parse.FieldMaker.makeField(FieldMaker.java:97)
at org.nlpcn.es4sql.parse.SqlParser.findSelect(SqlParser.java:140)
at org.nlpcn.es4sql.parse.SqlParser.parseSelect(SqlParser.java:88)
at org.nlpcn.es4sql.parse.SqlParser.parseSelect(SqlParser.java:64)
at org.nlpcn.es4sql.query.ESActionFactory.create(ESActionFactory.java:65)
at org.nlpcn.es4sql.SearchDao.explain(SearchDao.java:46)

@AqooDer AqooDer changed the title 无法支持常量参数,能看看怎么回事么? 无法支持常量结果,能看看怎么回事么? Oct 17, 2023
@shi-yuan
Copy link
Member

shi-yuan commented Jan 1, 2024

select count(*) as totle,script("all_sys","'全系统'"),script("state","1") from user where state in(1,8) 

@AqooDer
Copy link
Author

AqooDer commented Jan 15, 2024

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants