The table Elements stores 7 numbers. You need to obtain the full arrangement of these numbers. No createtableElements (iintnotnullprimarykey) GOinsertintoElementsvalues (1), (2), (3), (4), (5), (6), (7); WithElementsWithWeightas (selecti, power (2, (I-1) aswgtfromElements) selec
The table Elements stores 7 numbers. You need to obtain the full arrangement of these numbers. No create table Elements (I int not null primary key) GOinsert into Elementsvalues (1), (2), (3), (4), (5), (6 ), (7); With ElementsWithWeight as (select I, power (2, (I-1) as wgt from Elements) selec
The table Elements stores 7 numbers. You need to obtain the full arrangement of these numbers. <无>
create table Elements( i int not null primary key)GOinsert into Elementsvalues (1),(2),(3),(4),(5),(6),(7);
With ElementsWithWeight as( select i, power(2,(i-1)) as wgt from Elements)select E1.i, E2.i, E3.i, E4.i, E5.i, E6.i, E7.ifrom ElementsWithWeight as E1, ElementsWithWeight as E2, ElementsWithWeight as E3, ElementsWithWeight as E4, ElementsWithWeight as E5, ElementsWithWeight as E6, ElementsWithWeight as E7where (E1.wgt + E2.wgt + E3.wgt + E4.wgt + E5.wgt + E6.wgt + E7.wgt) = 127
Create table users (name char (2), value char (1), id number); insert into users values ('A', 'A', 1 ); insert into users values ('B', 'B', 2); insert into users values ('C', 'C', 3 ); insert into users values ('dd', 'D', 4); commit;
Select o. p as "arrange" from (select replace (sys_connect_by_path (value, ','), ',') p from users connect by nocycle value! = Prior value) o where length (o. p) = 2;
Select o. p as "arrange" from (select replace (sys_connect_by_path (value, ','), ',') p from users connect by nocycle value! = Prior value) o where length (o. p) = 3;
Select o. p as "arrange" from (select replace (sys_connect_by_path (value, ','), ',') p from users connect by nocycle value! = Prior value) o where length (o. p) = 4;