mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
row IN subselects (SCRUM)
This commit is contained in:
@ -773,3 +773,34 @@ a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where
|
||||
2 0 b
|
||||
NULL NULL NULL
|
||||
drop table t1,t2;
|
||||
drop table if exists t;
|
||||
create table t (a int, b real, c varchar(10));
|
||||
insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t);
|
||||
ROW(1, 1, 'a') IN (select a,b,c from t)
|
||||
1
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t);
|
||||
ROW(1, 2, 'a') IN (select a,b,c from t)
|
||||
NULL
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t);
|
||||
ROW(1, 1, 'a') IN (select b,a,c from t)
|
||||
1
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t where a is not null);
|
||||
ROW(1, 1, 'a') IN (select a,b,c from t where a is not null)
|
||||
1
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t where a is not null);
|
||||
ROW(1, 2, 'a') IN (select a,b,c from t where a is not null)
|
||||
0
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null);
|
||||
ROW(1, 1, 'a') IN (select b,a,c from t where a is not null)
|
||||
1
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a');
|
||||
ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a')
|
||||
1
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a');
|
||||
ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a')
|
||||
NULL
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a');
|
||||
ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a')
|
||||
1
|
||||
drop table if exists t;
|
||||
|
@ -434,3 +434,17 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
|
||||
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
|
||||
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2;
|
||||
drop table t1,t2;
|
||||
|
||||
drop table if exists t;
|
||||
create table t (a int, b real, c varchar(10));
|
||||
insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t);
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t);
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t);
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t where a is not null);
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t where a is not null);
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null);
|
||||
select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a');
|
||||
select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a');
|
||||
select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a');
|
||||
drop table if exists t;
|
||||
|
Reference in New Issue
Block a user