select org_code from ea_org_tree where org_name = '';
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like '001.063%';
就是这两条。
5 个解决方案
#1
钳套查询
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '')
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '')
#2
可是模糊查找的不是还有个'%'号吗。,。。这个怎么解决。
#3
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like ((select org_code from ea_org_tree where org_name = '都工办')+'%'); 这样子查出来就是空了,然后我分开查是对的。
#4
把最外层括号去掉
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '都工办')+'%';
你把 (select org_code from ea_org_tree where org_name = '都工办')当成你是模糊查询的字段,用like该怎么加%就怎么加。
#5
#1
钳套查询
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '')
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '')
#2
可是模糊查找的不是还有个'%'号吗。,。。这个怎么解决。
#3
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like ((select org_code from ea_org_tree where org_name = '都工办')+'%'); 这样子查出来就是空了,然后我分开查是对的。
#4
把最外层括号去掉
select org_id,org_code from ea_org_tree where org_name = '特殊帐号' and org_code like (select org_code from ea_org_tree where org_name = '都工办')+'%';
你把 (select org_code from ea_org_tree where org_name = '都工办')当成你是模糊查询的字段,用like该怎么加%就怎么加。