Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Rot-13/SQL/rot-13-1.sql
Normal file
6
Task/Rot-13/SQL/rot-13-1.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
select translate(
|
||||
'The quick brown fox jumps over the lazy dog.',
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
|
||||
'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'
|
||||
)
|
||||
from dual;
|
||||
25
Task/Rot-13/SQL/rot-13-2.sql
Normal file
25
Task/Rot-13/SQL/rot-13-2.sql
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
with cte(num) as
|
||||
(
|
||||
select 1
|
||||
union all
|
||||
select num+1
|
||||
from cte
|
||||
)
|
||||
select cast((
|
||||
select char(ascii(chr) +
|
||||
case
|
||||
when ascii(chr) between ascii('a') and ascii('m') or
|
||||
ascii(chr) between ascii('A') and ascii('M') then 13
|
||||
when ascii(chr) between ascii('n') and ascii('z') or
|
||||
ascii(chr) between ascii('N') and ascii('Z') then -13
|
||||
else 0
|
||||
end)
|
||||
from
|
||||
(
|
||||
select top(1000) num,
|
||||
-- your string to be converted to ROT13
|
||||
substring('The Quick Brown Fox Jumps Over The Lazy Dog',num,1) chr
|
||||
from cte
|
||||
) tmp
|
||||
For XML PATH ('')) as xml).value('.', 'VARCHAR(max)') rot13
|
||||
option (maxrecursion 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue