Это бесит жесть. Буквально на днях общались я, ПМ, и заказчик. Я говорю срок 5 февраля, но меня будто в упор не слышат и продолжают что-то буровить про 29 января, я снова заявляю что 5 февраля, но мне опять задают вопрос про закончить на конец этой недели. Они сами не пробиваемые, у них вечно все счет идет на часы и секунды.
CREATE TABLE `textlog` (
`id` int(11) NOT NULL,
`chat_id` int(111) NOT NULL,
`text` text CHARACTER SET NOT NULL,
`date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Также хоть я и коммитил, я не нахожу старых коммитов
create table t34 (user_id int, s varchar(200));
insert into t34 select 1,'q'
union all select 1,'w'
union all select 2,'a'
union all select 2,'s'
union all select 2,'d'
union all select 2,'f'
union all select 2,'g'
union all select 1,'t'
union all select 1,'e'
union all select 1,'r'
;
select
case when @userId<>user_id then @q:=1 else @q:=@q+1 end q,
case when @q=1 then @userId:=user_id else @userId end user_id,
s
from (select * from t34 order by user_id) t1, (select @userId:=0, @q:=1) t2
where user_id<>@userId or (user_id=@userId and @q<=2)
Т.е. в слове slovoblud будет отрезана первая часть, при таком подходе.