Search
 
SCRIPT & CODE EXAMPLE
 

SQL

plsql to generate all combinations of specified number of characters in string

SQL> declare

  2    cn_string constant varchar2(3) := 'HER';

  3  begin

  4    for i in 1..3

  5    loop

  6      for j in 1..3

  7      loop

  8        for k in 1..3

  9        loop

 10          if    i != j

 11            and j != k

 12            and k != i

 13          then

 14            dbms_output.put_line

 15            ( substr(cn_string,i,1) ||

 16              substr(cn_string,j,1) ||

 17              substr(cn_string,k,1)

 18            );

 19          end if;

 20        end loop;

 21      end loop;

 22    end loop;

 23  end;

 24  /

HER

HRE

EHR

ERH

RHE

REH
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql db dump restore max file size issue 
Sql :: do you know sql 
Sql :: como hacer una consulta de un registro que no esta en una tabla en mysql 
Sql :: oracle query archive mode 
Sql :: get created time of database psql 8 
Sql :: oracle select tree structure 
Sql :: mysql does sentance contain word 
Sql :: sql save select into list 
Sql :: plsql listagg 
Sql :: mysql join table with a text columns with ids splited by char 
Sql :: sparql year function 
Sql :: sql server separar numeros por comas miles 
Sql :: sql oop example 
Sql :: bidirectional outer join sql 
Sql :: trigger vérifier stock 
Sql :: sql to move data from one table to another 
Sql :: MySQL - How to find word with the most similar beginning 
Sql :: today midnight SQL 
Sql :: list foreign user mapping postgres 
Sql :: Update Multiple Values in a Row 
Sql :: mysql primary vs unique 
Sql :: mysql max number not returning correct value 
Sql :: mysql grant user wildcard database 
Sql :: oracle query to find schema you are working on 
Sql :: sql select in where clause for when more than one records exists 
Sql :: postgresql get tables where column is foreign key 
Sql :: oracle parse string 
Sql :: select all same column value in sql 
Sql :: capabilities of sql select statements 
Sql :: deletar banco de dados mysql 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =