clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591620 fiddles created (45698 in the last week).

create table table1 (value1 varchar (10), number1 int, number2 int);
 hidden batch(es)


insert into table1 (value1, number1, number2) select 'ab',123,13 from dual union all select 'ac',312,32 from dual union all select 'cd',343,45 from dual union all select 'sr',123,353 from dual union all select 'de',3453,2452 from dual union all select 'hg',5343,345 from dual union all select 'cr',345,3543 from dual
7 rows affected
 hidden batch(es)


select * from table1
VALUE1 NUMBER1 NUMBER2
ab 123 13
ac 312 32
cd 343 45
sr 123 353
de 3453 2452
hg 5343 345
cr 345 3543
 hidden batch(es)


with cte as (select row_number () over (order by value1) as id,value1, number1, number2 from table1) select c1.value1, c2.value1 as value2, c1.number1, c1.number2 from cte c1 join cte c2 on c1.id<c2.id order by 1
VALUE1 VALUE2 NUMBER1 NUMBER2
ab de 123 13
ab cr 123 13
ab cd 123 13
ab ac 123 13
ab hg 123 13
ab sr 123 13
ac hg 312 32
ac de 312 32
ac cr 312 32
ac cd 312 32
ac sr 312 32
cd cr 343 45
cd de 343 45
cd hg 343 45
cd sr 343 45
cr de 345 3543
cr sr 345 3543
cr hg 345 3543
de sr 3453 2452
de hg 3453 2452
hg sr 5343 345
 hidden batch(es)