qiu'zhu

idontsay33 2017-12-09 09:07:21

求助怎么才能查询出与01的b2值完全相同的b1呢?
...全文
276 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
alex259 2017-12-11
  • 打赏
  • 举报
回复
引用 5 楼 idontsay33 的回复:
有没大佬帮助一蛤的
如果你的B1是varchar型的数字 B2是number型的数字 那就直接to_number B1然后和B2去做比较
碧水幽幽泉 2017-12-11
  • 打赏
  • 举报
回复
已知:a = [(4,2,3), (5, 9, 1), (7,8,9)]
希望将二维列表转换成一维列表:["4,2,3", "5, 9, 1", "7,8,9"]

>>> a = [(4,2,3), (5, 9, 1), (7,8,9)]
>>> from itertools import chain
>>> list(chain.from_iterable(a))
[4, 2, 3, 5, 9, 1, 7, 8, 9]
>>> from tkinter import _flatten # python2.7也可以from compiler.ast import flatten
>>> _flatten(a)
(4, 2, 3, 5, 9, 1, 7, 8, 9)

>>> [','.join(map(str,t)) for t in a]
['4,2,3', '5,9,1', '7,8,9']
>>> from itertools import starmap
>>> list(starmap('{},{},{}'.format,a))
['4,2,3', '5,9,1', '7,8,9']

笨办法,提供一种思路
a = [(4, 2, 3), (5,9,1), (7,8,9)]
i=0
while i<3:
a[i]=str(a[i])[1:3*3-1]
i=i+1
print (a[0:3])

>>>
['4, 2, 3', '5, 9, 1', '7, 8, 9']
mj845573397 2017-12-11
  • 打赏
  • 举报
回复
select b1 from dual where b2 in (select b2 from dual where b1=01)
mj845573397 2017-12-11
  • 打赏
  • 举报
回复
select b1 from dual where dual in (select b2 from b where b1=01) 这样写呢
idontsay33 2017-12-10
  • 打赏
  • 举报
回复
有没大佬帮助一蛤的
idontsay33 2017-12-09
  • 打赏
  • 举报
回复
引用 3 楼 baidu_36457652 的回复:

with t1(b1,b2)
 as (select  '01',1 from dual union 
 select '01',2 from dual  union
 select '02', 1 from dual union 
 select '02' ,2 from dual )
 select * from t1 where regexp_substr(b1,'[^0]+',1,1)=b2
/*    	B1	B2
1	01	1
2	02	2
*/
呃,抱歉,没怎么看懂,能解释一蛤吗?
  • 打赏
  • 举报
回复

with t1(b1,b2)
 as (select  '01',1 from dual union 
 select '01',2 from dual  union
 select '02', 1 from dual union 
 select '02' ,2 from dual )
 select * from t1 where regexp_substr(b1,'[^0]+',1,1)=b2
/*    	B1	B2
1	01	1
2	02	2
*/
idontsay33 2017-12-09
  • 打赏
  • 举报
回复
引用 1 楼 baidu_36457652 的回复:
啥子意思 你说下想得到的结果
查询b1 条件是 b2完全等于01的b2
  • 打赏
  • 举报
回复
啥子意思 你说下想得到的结果
TopicExpertiseModel =================== /** Copyright (C) 2013 by SMU Text Mining Group/Singapore Management University/Peking University TopicExpertiseModel is distributed for research purpose, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you use this code, please cite the following paper: Liu Yang, Minghui Qiu, Swapna Gottipati, Feida Zhu, Jing Jiang, Huiping Sun and Zhong Chen. CQARank: Jointly Model Topics and Expertise in Community Question Answering. In Proceedings of the 22nd ACM International Conference on Information and Knowledge Management (CIKM 2013). (http://dl.acm.org/citation.cfm?id=2505720) Feel free to contact the following people if you find any problems in the package. yang.liu@pku.edu.cn * */ Brief Introduction =================== 1. Community Question Answering (CQA) websites, where people share expertise on open platforms, have become large repositories of valuable knowledge. To bring the best value out of these knowledge repositories, it is critically important for CQA services to know how to find the right experts, retrieve archived similar questions and recommend best answers to new questions. To tackle this cluster of closely related problems in a principled approach, we proposed Topic Expertise Model (TEM), a novel probabilistic generative model with GMM hybrid, to jointly model topics and expertise by integrating textual content model and link structure analysis. Based on TEM results, we proposed CQARank to measure user interests and expertise score under different topics. Leveraging the question answering history based on long-term community reviews and voting, our method could find experts with both similar topical preference and high topical expertise. 2. This package implements Gibbs sampling for Topic Expertise Model for jointly modeling topics and expertise in question answering communities. More details of our model are described in the following paper: Liu Yang, Minghui Qiu, Swapna Gottipati, Feida Zhu, Jing Jiang, Huiping Sun and Zhong Chen. CQARank: Jointly Model Topics and Expertise in Community Question Answering. In Proceedings of the 22nd ACM International Conference on Information and Knowledge Management (CIKM 2013). (http://dl.acm.org/citation.cfm?id=2505720)

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧