複雑なクエリ
最近の連続失敗回数が3回の登録番号を求めるクエリがわかりません。
教えてください。
DBは、MySQL version: 4.0.22で、副問合せ等は使用できません。
create table t_test(
n_no integer,-- 登録番号
n_flg integer,-- 0:成功1:失敗
d_update date-- 更新日付
);
insert into t_test (n_no, n_flg, d_update)values (1,0,'2007-06-01');
insert into t_test (n_no, n_flg, d_update)values (1,0,'2007-06-02');
insert into t_test (n_no, n_flg, d_update)values (1,0,'2007-06-03');
insert into t_test (n_no, n_flg, d_update)values (1,1,'2007-06-04');
insert into t_test (n_no, n_flg, d_update)values (1,1,'2007-06-05');
insert into t_test (n_no, n_flg, d_update)values (2,0,'2007-06-01');
insert into t_test (n_no, n_flg, d_update)values (2,0,'2007-06-02');
insert into t_test (n_no, n_flg, d_update)values (2,1,'2007-06-03');
insert into t_test (n_no, n_flg, d_update)values (2,1,'2007-06-04');
insert into t_test (n_no, n_flg, d_update)values (2,1,'2007-06-05');
insert into t_test (n_no, n_flg, d_update)values (3,0,'2007-06-03');
insert into t_test (n_no, n_flg, d_update)values (3,1,'2007-06-04');
insert into t_test (n_no, n_flg, d_update)values (3,1,'2007-06-05');
insert into t_test (n_no, n_flg, d_update)values (3,1,'2007-06-06');
insert into t_test (n_no, n_flg, d_update)values (3,0,'2007-06-07');