You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
selectt2.fld1,t2.companynr,fld3,periodfrom t3,t2 where (t2.fld1=38208ort2.fld1=38008) andt2.fld1=t3.t2nrandperiod>=1008andperiod<=1009;
1593
+
selectt2.fld1,t2.companynr,fld3,period_from t3,t2 where (t2.fld1=38208ort2.fld1=38008) andt2.fld1=t3.t2nrandperiod_>=1008andperiod_<=1009;
1594
1594
1595
-
selectt2.fld1,t2.companynr,fld3,periodfrom t3,t2 where (t3.t2nr=38208ort3.t2nr=38008) andt2.fld1=t3.t2nrandperiod>=1008andperiod<=1009;
1595
+
selectt2.fld1,t2.companynr,fld3,period_from t3,t2 where (t3.t2nr=38208ort3.t2nr=38008) andt2.fld1=t3.t2nrandperiod_>=1008andperiod_<=1009;
1596
1596
1597
1597
#
1598
1598
# Test of many parenthesis levels
1599
1599
#
1600
1600
1601
-
selectperiodfrom t1 where (((period>0) orperiod<10000or (period=1900)) and (period=1900andperiod<=1901) or (period=1903and (period=1903)) andperiod>=1902) or ((period=1904orperiod=1905) or (period=1906orperiod>1907)) or (period=1908andperiod=1909);
1602
-
selectperiodfrom t1 where ((period>0andperiod<1) or (((period>0andperiod<100) and (period>10)) or (period>10)) or (period>0and (period>5orperiod>6)));
1601
+
selectperiod_from t1 where (((period_>0) orperiod_<10000or (period_=1900)) and (period_=1900andperiod_<=1901) or (period_=1903and (period_=1903)) andperiod_>=1902) or ((period_=1904orperiod_=1905) or (period_=1906orperiod_>1907)) or (period_=1908andperiod_=1909);
1602
+
selectperiod_from t1 where ((period_>0andperiod_<1) or (((period_>0andperiod_<100) and (period_>10)) or (period_>10)) or (period_>0and (period_>5orperiod_>6)));
1603
1603
1604
1604
selecta.fld1from t2 as a,t2 b where ((a.fld1=250501anda.fld1=b.fld1) ora.fld1=250502ora.fld1=250503or (a.fld1=250505anda.fld1<=b.fld1andb.fld1>=a.fld1)) anda.fld1=b.fld1;
1605
1605
@@ -1657,7 +1657,7 @@ select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 grou
1657
1657
# Calculation with group functions
1658
1658
#
1659
1659
1660
-
selectsum(Period)/count(*) from t1;
1660
+
selectsum(Period_)/count(*) from t1;
1661
1661
select companynr,count(price) as"count",sum(price) as"sum" ,abs(sum(price)/count(price)-avg(price)) as"diff",(0+count(price))*companynr as func from t3 group by companynr;
1662
1662
select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg >70000000order by avg;
1663
1663
@@ -1747,13 +1747,13 @@ select max(t2nr) from t3 where price=983543950;
1747
1747
# Test of alias
1748
1748
#
1749
1749
1750
-
selectt1.periodfrom t3 = t1 limit1;
1751
-
selectt1.periodfrom t1 as t1 limit1;
1752
-
selectt1.periodas"Nuvarande period"from t1 as t1 limit1;
1753
-
selectperiodas ok_period from t1 limit1;
1754
-
selectperiodas ok_period from t1 group by ok_period limit1;
1750
+
selectt1.period_from t3 = t1 limit1;
1751
+
selectt1.period_from t1 as t1 limit1;
1752
+
selectt1.period_as"Nuvarande period_"from t1 as t1 limit1;
1753
+
selectperiod_as ok_period from t1 limit1;
1754
+
selectperiod_as ok_period from t1 group by ok_period limit1;
1755
1755
select1+1as summa from t1 group by summa limit1;
1756
-
selectperiodas"Nuvarande period"from t1 group by"Nuvarande period"limit1;
1756
+
selectperiod_as"Nuvarande period_"from t1 group by"Nuvarande period_"limit1;
Copy file name to clipboardExpand all lines: mysql-test/r/auto_increment.result
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -537,3 +537,62 @@ pk
537
537
-5
538
538
1
539
539
drop table t1;
540
+
#
541
+
# System Versioning Support
542
+
#
543
+
#
544
+
CREATE TABLE t1(id INT UNSIGNED AUTO_INCREMENT, x INT UNSIGNED, y INT UNSIGNED, Sys_start TIMESTAMP(6) GENERATED ALWAYS AS ROW START, Sys_end TIMESTAMP(6) GENERATED ALWAYS AS ROW END, PERIOD FOR SYSTEM_TIME (Sys_start, Sys_end), PRIMARY KEY (id)) WITH SYSTEM VERSIONING;
545
+
CREATE TABLE T1(id INT UNSIGNED AUTO_INCREMENT, x INT UNSIGNED, y INT UNSIGNED, PRIMARY KEY (id));
546
+
INSERT INTO t1(x, y) VALUES(1, 11);
547
+
INSERT INTO T1(x, y) VALUES(1, 11);
548
+
INSERT INTO t1(x, y) VALUES(2, 12);
549
+
INSERT INTO T1(x, y) VALUES(2, 12);
550
+
INSERT INTO t1(x, y) VALUES(3, 13);
551
+
INSERT INTO T1(x, y) VALUES(3, 13);
552
+
INSERT INTO t1(x, y) VALUES(4, 14);
553
+
INSERT INTO T1(x, y) VALUES(4, 14);
554
+
INSERT INTO t1(x, y) VALUES(5, 15);
555
+
INSERT INTO T1(x, y) VALUES(5, 15);
556
+
INSERT INTO t1(x, y) VALUES(6, 16);
557
+
INSERT INTO T1(x, y) VALUES(6, 16);
558
+
INSERT INTO t1(x, y) VALUES(7, 17);
559
+
INSERT INTO T1(x, y) VALUES(7, 17);
560
+
INSERT INTO t1(x, y) VALUES(8, 18);
561
+
INSERT INTO T1(x, y) VALUES(8, 18);
562
+
INSERT INTO t1(x, y) VALUES(9, 19);
563
+
INSERT INTO T1(x, y) VALUES(9, 19);
564
+
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
565
+
t1.x = T1.x AND t1.y = T1.y x y x y
566
+
1 1 11 1 11
567
+
1 2 12 2 12
568
+
1 3 13 3 13
569
+
1 4 14 4 14
570
+
1 5 15 5 15
571
+
1 6 16 6 16
572
+
1 7 17 7 17
573
+
1 8 18 8 18
574
+
1 9 19 9 19
575
+
DELETE FROM t1 WHERE x=2;
576
+
DELETE FROM T1 WHERE x=2;
577
+
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
578
+
t1.x = T1.x AND t1.y = T1.y x y x y
579
+
1 1 11 1 11
580
+
1 3 13 3 13
581
+
1 4 14 4 14
582
+
1 5 15 5 15
583
+
1 6 16 6 16
584
+
1 7 17 7 17
585
+
1 8 18 8 18
586
+
1 9 19 9 19
587
+
DELETE FROM t1 WHERE x>7;
588
+
DELETE FROM T1 WHERE x>7;
589
+
SELECT t1.x = T1.x AND t1.y = T1.y, t1.x, t1.y, T1.x, T1.y FROM t1 INNER JOIN T1 ON(t1.id = T1.id);
0 commit comments