java - Mysql多条件批量查询

查看:1251
本文介绍了java - Mysql多条件批量查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

请教一个问题:mysql中,我查询语句
select * from tableA where name='test' and age='18';
然后我有一个name和age的list列表,分别通过这两个条件去查询,有什么比较方法可以查询;

eg:
select * from tableA where name='test' and age='18';
select * from tableA where name='test1' and age='18';
select * from tableA where name='test2' and age='20';
select * from tableA where name='test2' and age='56';
···

其中查出来的数据对应Java的一个实体。其中List表的大小为500-3000,数据表的记录为每天8万左右

解决方案

建立视图查询,这样效率会好点。至少比临时表效率稍快

这篇关于java - Mysql多条件批量查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆