Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
with t as ( select value, row_number() over (order by (select null)) as rn from string_split('тип паспорта;серия;номер;орган выдачи;дата выдачи', ';') ) select max(case when rn = 1 then value end) as t, max(case when rn = 2 then value end) as s, max(case when rn = 3 then value end) as n, max(case when rn = 4 then value end) as o, max(case when rn = 5 then value end) as d from t;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear