我想将数据搜索到表
我的表结构是表:tbl_clientinfo_dplist
private static final int LIMIT = 255;
private static final int SHIFT = 256; // or whatever > LIMIT, e.g. 1000
public float colorToHeight(Color c){
int b = (int) Math.round(c.getBlue() * LIMIT);
int r = (int) Math.round(c.getRed() * LIMIT);
float h = (b + r * SHIFT) / 2f;
h -= 10000;
return h;
}
public Color heightToColor(float h){
h += 10000;
h *= 2;
double r = (int) (h / SHIFT);
double b = h - (r * SHIFT);
return new Color(r / LIMIT, 0, b / LIMIT, 1f);
}
我的另一个表结构是表:tbl_client
dplist_id dp_id dplist
-------------------------------
1 1 aaa
2 1 bbb
3 1 ccc
4 1 ddd
5 2 eee
6 2 fff
7 2 ggg
dp_id = 1是提供者类型,dp_id = 2是组名。
如何从表中搜索提供者类型或组名?
这是我当前的查询
client_id provider_type group_name cmp_legal_name
---------------------------------------------------------------
1 1 5 Test1
2 2 6 Test2
3 3 7 Test3
4 1 5 Test4
5 4 6 Test5
答案 0 :(得分:1)
仅供参考,以上内容可以改写如下,我认为更容易理解......
SELECT columns, I, actually, need
FROM tbl_client c
LEFT
JOIN tbl_clientinfo_dplist l
ON l.dplist_id IN(c.provider_type,c.group_name)