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

数据集查询参数为空的问题 #42

Closed
zsedcbm opened this issue Aug 17, 2017 · 1 comment
Closed

数据集查询参数为空的问题 #42

zsedcbm opened this issue Aug 17, 2017 · 1 comment

Comments

@zsedcbm
Copy link

zsedcbm commented Aug 17, 2017

select * from employee where area like :area
此处如果:area参数的默认值为空的时候,将会数据预览失败,无法读取字段. 如果参数传入的值为 上海% 的时候,过滤条件无效
后来此处改为 where area like concat(:area,'%') 之后, area参数默认值%
参数传入值为 上海 时,过滤条件有效
参数传入值为 上海% 时,过滤条件无效

具体的业务需求为 当area为空的时候,显示所有数据,当area为上海的时候,显示所有上海区域的数据.

@youseries
Copy link
Owner

youseries commented Aug 18, 2017

最新版SQL支持表达式,利用表达式就可以实现你的需求,具体使用见:http://wiki.bsdn.org/pages/viewpage.action?pageId=76448802

@zsedcbm zsedcbm closed this as completed Aug 18, 2017
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