Home > database >  Qiu, 'zhu,
Qiu, 'zhu,

Time:09-25


For help how to query the b2 values are identical with 01 b1?

CodePudding user response:

Results the desired mean what you say

CodePudding user response:

reference 1st floor baidu_36457652 response:
what mean you said want to get the result of


The query is b2 completely equal to 01 b2 b1 conditions

CodePudding user response:

 
With t1 (b1, b2)
As (select '01, 1 from dual union
Select '01, 2 from dual union
Select the '02', 1 from dual union
Select the '02', 2 from dual)
Select * from t1 where regexp_substr (b1, '[^ 0] +, 1, 1)=b2
/* B1 B2
01 1
02 2
*/

CodePudding user response:

The
reference 3 floor baidu_36457652 response:
 
With t1 (b1, b2)
As (select '01, 1 from dual union
Select '01, 2 from dual union
Select the '02', 1 from dual union
Select the '02', 2 from dual)
Select * from t1 where regexp_substr (b1, '[^ 0] +, 1, 1)=b2
/* B1 B2
01 1
02 2
*/


Well, I'm sorry, didn't understand, can explain a clam?

CodePudding user response:

There are no bosses help a clam

CodePudding user response:

reference 5 floor idontsay33 reply:
there are no bosses to help a clam


If your B1 type is varchar digital
B2 type is number number
The to_number B1 and B2 to compare directly

CodePudding user response:

Select b1 from dual where dual (select b2 in the from b where b1=01) like this

CodePudding user response:

The select b1 from dual where b2 (select b2 in the from dual where b1=01)

CodePudding user response:

Known: a=[(4, 2, 3), (5, 9, 1), (7,8,9)]
Hope to convert two-dimensional list into a one-dimensional list: [4, 2, 3, 5, 9, "1", "7,8,9"]

> A=[(4, 2, 3), (5, 9, 1), (7,8,9)]
> The from itertools import chain
> The list (chain. From_iterable (a))
[4, 2, 3, 5, 9, 1, 7, 8, 9]
> The from tkinter import _flatten # python2.7 can also from the compiler. The 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]
> The from itertools import starmap
> The list (starmap (' {}, {}, {}. The format, a))
[' 4, 2, 3 ', '5,9,1', '7,8,9]

Stupid way, provide a kind of thinking
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 [3-0])

>
[' 4, 2, 3 ', '5, 9, 1', '7, 8, 9]