Главная Настройка Mobile Контакты NSFW Каталог Пожертвования Купить пасскод Pics Adult Pics API Архив Реквест доски Каталог стикеров Реклама
Доски


[Ответить в тред] Ответить в тред

Check this out!


[Назад][Обновить тред][Вниз][Каталог] [ Автообновление ] 2 | 2 | 2
Назад Вниз Каталог Обновить

Тестовое задание sql Аноним 22/06/17 Чтв 10:54:23  1009787  
e8da113f-4c5a-4[...].jpg (547Кб, 1024x737)
Пачаны сильно не обассывайте. Нужно найти 8 ошибок задании - запятые, "грамматические".
С меня как обычно.

select name_r 'Имя', rtpl_id rtpl,
count(distinct case when s<153 then subs_id else null end) x153,
count(distinct case when 153<=s and s<306 then subs_id else null end) x306,
count(distinct case when 305<=s and s<459 then subs_id else null end) x459,
count(distinct case when 459<=s and s<612 then subs_id else null end) x612,
count(distinct case when 612<=s and s<765 then subs_id else null end) x765,
count(distinct case when 765<=s and s<918 then subs_id else null end) x918,
count(distinct case when 918<=s and s<1071 then subs_id else null end) x1071,
count(distinct case when 1071<=s and s<1224 then subs_id else null end) x1224,
count(distinct case when 1224<=s and s<1377 then subs_id else null end) x1377,
count(distinct case when 1377<=s and s<1530 then subs_id else null end) x1530,
count(distinct case when 1530<=s and s<2294 then subs_id else null end) x2294,
count(distinct case when 2294<=s and s<3059 then subs_id else null end) x3059,
count(distinct case when 3059<=s then subs_id else null end) y3059,
from (
select s.subs_id,
case when nvl(c.subs_count,0)<>0 then amount_r/c.subs_count else 0 end "s",
x.name_r, x.rtpl_id
from r_20070730 r, agg.client_d c agg.subs_d s, (select * from bis.rate_plans x where x.end_date='31.12.2999') x where c.d='01/07/2007'
and s.d=to_date('01.07.2007','dd.mm.yyyy')
and c.client_id=r.clnt_clnt_id
and s.client_id=c.client_id
-- and s.status_bu in (4,6)
and s.sbst_id = 2 and s.status_bu = 4
and s.rtpl_id=x.rtpl_id
and x.rtpl_id not in [0,169]
)
group by name_r, rtpl_id rtpl
Аноним 22/06/17 Чтв 10:56:42  1009790
f9dd5cf9-24e9-4[...].jpg (96Кб, 1280x700)
Добавил номера строк для удобства. В 13, 14 нашел две отсутствующие запятые.

1 select name_r 'Имя', rtpl_id rtpl,
2 count(distinct case when s<153 then subs_id else null end) x153,
3 count(distinct case when 153<=s and s<306 then subs_id else null end) x306,
4 count(distinct case when 305<=s and s<459 then subs_id else null end) x459,
5 count(distinct case when 459<=s and s<612 then subs_id else null end) x612,
6 count(distinct case when 612<=s and s<765 then subs_id else null end) x765,
7 count(distinct case when 765<=s and s<918 then subs_id else null end) x918,
8 count(distinct case when 918<=s and s<1071 then subs_id else null end) x1071,
9 count(distinct case when 1071<=s and s<1224 then subs_id else null end) x1224,
10 count(distinct case when 1224<=s and s<1377 then subs_id else null end) x1377,
11 count(distinct case when 1377<=s and s<1530 then subs_id else null end) x1530,
12 count(distinct case when 1530<=s and s<2294 then subs_id else null end) x2294,
13 count(distinct case when 2294<=s and s<3059 then subs_id else null end) x3059,
14 count(distinct case when 3059<=s then subs_id else null end) y3059,
15 from (
16 select s.subs_id,
17 case when nvl(c.subs_count,0)<>0 then amount_r/c.subs_count else 0 end "s",
18 x.name_r, x.rtpl_id
19 from r_20070730 r, agg.client_d c agg.subs_d s, (select * from bis.rate_plans x where x.end_date='31.12.2999') x where c.d='01/07/2007'
20 and s.d=to_date('01.07.2007','dd.mm.yyyy')
21 and c.client_id=r.clnt_clnt_id
22 and s.client_id=c.client_id
23 -- and s.status_bu in (4,6)
24 and s.sbst_id = 2 and s.status_bu = 4
25 and s.rtpl_id=x.rtpl_id
26 and x.rtpl_id not in [0,169]
27 )
28 group by name_r, rtpl_id rtpl
Аноним 22/06/17 Чтв 11:17:43  1009805
Открой любой SQL Editor, там тебе подсветят.
2017 год на дворе, какие на хуй запятые.

[Назад][Обновить тред][Вверх][Каталог] [Реквест разбана] [Подписаться на тред] [ ] 2 | 2 | 2
Назад Вверх Каталог Обновить

Топ тредов
Избранное