SQLize Online / PHPize Online

A A A
Share   Donate   Blog   Popular
Copy Format Clear
CREATE TABLE Department(id integer, name text); CREATE TABLE Personal(id integer, id_head integer, id_dep integer, name text, sal integer); INSERT INTO Department VALUES(1, 'Финансы'); INSERT INTO Department VALUES(2, 'Риски'); INSERT INTO Department VALUES(3, 'Розница'); INSERT INTO Department VALUES(4, 'Безопасность'); INSERT INTO Department VALUES(1000, 'ДКК'); INSERT INTO Personal VALUES(1, 1, 2, 'Бегинс', 45000); INSERT INTO Personal VALUES(2, 1, 2, 'Поттер', 80000); INSERT INTO Personal VALUES(3, 2, 2, 'Чапаева', 100000); INSERT INTO Personal VALUES(4, 4, 4, 'Шилов', 65000); INSERT INTO Personal VALUES(10000, 5, 3, 'Наумов', 64500); SELECT Фамилия FROM (SELECT name AS Фамилия, LENGTH(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE (REPLACE(REPLACE(REPLACE(name, 'а', 1), 'е', 1), 'ё', 1), 'и', 1), 'о', 1), 'у', 1), 'ы', 1), 'э', 1), 'ю', 1), 'я', 1))-LENGTH(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE (REPLACE(REPLACE(REPLACE(REPLACE(name, 'а', 1), 'е', 1), 'ё', 1), 'и', 1), 'о', 1), 'у', 1), 'ы', 1), 'э', 1), 'ю', 1), 'я', 1), 1, '')) AS Гласные FROM Department ) ORDER BY Гласные DESC;
Stuck with a problem? Need help? Ask professionals on our Telegram channel!
Join the channel
Your quersion is posted.
Join our Telegram channel and get answers.
Send
Copy