qiu'zhu 求助怎么才能查询出与01的b2值完全相同的b1呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 查询b1 条件是 b2完全等于01的b2 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 B21 01 12 02 2*/ 如果你的B1是varchar型的数字B2是number型的数字那就直接to_number B1然后和B2去做比较 select b1 from dual where dual in (select b2 from b where b1=01) 这样写呢 select b1 from dual where b2 in (select b2 from dual where b1=01) 已知: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=0while i<3: a[i]=str(a[i])[1:3*3-1] i=i+1print (a[0:3])>>> ['4, 2, 3', '5, 9, 1', '7, 8, 9'] SQL语句 求助:如何实现三个表的全连接查询? 转移含CLOB字段的表的 表空间的后,对该表无法执行DML操作,也不可以删除,请问如何删除这个表 。 求CNOUG邀请码一个 rman backup archivelog all delete input? 帮忙看看这个SQL怎么优化一下?谢谢了 使用truncate table时遇到的问题. 一个简单的SQL语句的问题............ 语法问题,高手请进 多数据库系统支持的问题 数据库 ALTER TABLE school ALLOCATE EXTENT SIZE 10M;
查询b1 条件是 b2完全等于01的b2
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
*/
如果你的B1是varchar型的数字
B2是number型的数字
那就直接to_number B1然后和B2去做比较
希望将二维列表转换成一维列表:["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']