oceanbase
166 строк · 2.9 Кб
1can't determine a row
2drop table if exists t1;
3create table t1(c1 int, c2 int, primary key(c1));
4insert into t1 values(1,1),(2,2),(3,3);
5delete from t1 where c1 in(1);
6select * from t1;
7c1 c2
82 2
93 3
10delete from t1 where c1 in(1,2);
11select * from t1;
12c1 c2
133 3
14delete from t1 where c1>=3;
15select * from t1;
16c1 c2
17insert into t1 values(1,1),(2,2),(3,3);
18delete from t1 where c1<=1;
19select * from t1;
20c1 c2
212 2
223 3
23delete from t1 where 1>=c1;
24select * from t1;
25c1 c2
262 2
273 3
28delete from t1 where 3<=c1;
29select * from t1;
30c1 c2
312 2
32delete from t1 where 2<=c1;
33select * from t1;
34c1 c2
35insert into t1 values(1,1),(2,2),(3,3);
36delete from t1 where c1>1 and c1<3;
37select * from t1;
38c1 c2
391 1
403 3
41delete from t1 where c1=1 or c1=2;
42select * from t1;
43c1 c2
443 3
45delete from t1 where c1<1 or c1<2;
46select * from t1;
47c1 c2
483 3
49delete from t1 where c1=1 and c1=2;
50select * from t1;
51c1 c2
523 3
53delete from t1 where c1>1 and c1=2;
54select * from t1;
55c1 c2
563 3
57drop table if exists t1;
58create table t1(c1 int, c2 int, primary key(c1));
59insert into t1 values(1,1),(2,2),(3,3);
60delete from t1 where c2 in(1);
61select * from t1;
62c1 c2
632 2
643 3
65delete from t1 where c2 in(1,2);
66select * from t1;
67c1 c2
683 3
69delete from t1 where c2>=3;
70select * from t1;
71c1 c2
72insert into t1 values(1,1),(2,2),(3,3);
73delete from t1 where c2<=1;
74select * from t1;
75c1 c2
762 2
773 3
78delete from t1 where 1>=c2;
79select * from t1;
80c1 c2
812 2
823 3
83delete from t1 where 3<=c2;
84select * from t1;
85c1 c2
862 2
87delete from t1 where c2>1 and c2<3;
88select * from t1;
89c1 c2
90delete from t1 where c2=1 or c2=2;
91select * from t1;
92c1 c2
93delete from t1 where c2<1 or c2<2;
94select * from t1;
95c1 c2
96delete from t1 where c2=1 and c2=2;
97select * from t1;
98c1 c2
99delete from t1 where c2>1 and c2=2;
100select * from t1;
101c1 c2
102drop table if exists t1;
103create table t1(c1 int, c2 int, primary key(c1));
104insert into t1 values(1,1),(2,2),(3,3);
105delete from t1 where (c1,c2) in((1,1));
106select * from t1;
107c1 c2
1082 2
1093 3
110delete from t1 where (c1,c2) in((1,1),(2,2));
111select * from t1;
112c1 c2
1133 3
114delete from t1 where (c2,c1) in((1,1));
115select * from t1;
116c1 c2
1173 3
118delete from t1 where (c2,c1) in((1,1),(2,2));
119select * from t1;
120c1 c2
1213 3
122delete from t1 where c1 > 1 and c2 >10 and c1=1;
123select * from t1;
124c1 c2
1253 3
126delete from t1 where c1 > 1 or c2 >10 and c1=1;
127select * from t1;
128c1 c2
129drop table if exists t1;
130create table t1(c1 int, c2 int, primary key(c1));
131insert into t1 values(1,1),(2,2),(3,3);
132delete from t1 where c2<=1;
133select * from t1;
134c1 c2
1352 2
1363 3
137delete from t1 where 1>=c2;
138select * from t1;
139c1 c2
1402 2
1413 3
142delete from t1 where 3<=c2;
143select * from t1;
144c1 c2
1452 2
146delete from t1 where c2>1 and c2<3;
147select * from t1;
148c1 c2
149insert into t1 values(1,1),(2,2),(3,3);
150delete from t1 where c2=1 or c2=2;
151select * from t1;
152c1 c2
1533 3
154delete from t1 where c2<1 or c2<2;
155select * from t1;
156c1 c2
1573 3
158delete from t1 where c2=1 and c2=2;
159select * from t1;
160c1 c2
1613 3
162delete from t1 where c2>1 and c2=2;
163select * from t1;
164c1 c2
1653 3
166drop table if exists t1;
167