Debian Codegraph @

mysql-test/suite/ndb/r/ndb_limit.result

raw
1 DROP TABLE IF EXISTS t2;
2 CREATE TABLE t2 (
3 a bigint unsigned NOT NULL PRIMARY KEY,
4 b int unsigned not null,
5 c int unsigned
6 ) engine=ndbcluster;
7 select count(*) from t2;
8 count(*)
9 10000
10 delete from t2 limit 1;
11 select count(*) from t2;
12 count(*)
13 9999
14 delete from t2 limit 100;
15 select count(*) from t2;
16 count(*)
17 9899
18 delete from t2 limit 1000;
19 select count(*) from t2;
20 count(*)
21 8899
22 update t2 set c=12345678 limit 100;
23 select count(*) from t2 where c=12345678;
24 count(*)
25 100
26 select count(*) from t2 where c=12345678 limit 1000;
27 count(*)
28 100
29 select * from t2 limit 0;
30 a b c
31 drop table t2;
32 CREATE TABLE `t2` (
33 `views` int(11) NOT NULL default '0',
34 `clicks` int(11) NOT NULL default '0',
35 `day` date NOT NULL,
36 `hour` tinyint(4) NOT NULL default '0',
37 `bannerid` smallint(6) NOT NULL default '0',
38 `zoneid` smallint(6) NOT NULL default '0',
39 `source` varchar(50) NOT NULL default '',
40 PRIMARY KEY (`day`,`hour`,`bannerid`,`zoneid`,`source`),
41 KEY `bannerid_day` (`bannerid`,`day`),
42 KEY `zoneid` (`zoneid`)
43 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
44 Warnings:
45 Warning 1681 Integer display width is deprecated and will be removed in a future release.
46 Warning 1681 Integer display width is deprecated and will be removed in a future release.
47 Warning 1681 Integer display width is deprecated and will be removed in a future release.
48 Warning 1681 Integer display width is deprecated and will be removed in a future release.
49 Warning 1681 Integer display width is deprecated and will be removed in a future release.
50 INSERT INTO `t2` VALUES
51 ( 1,0,'2004-09-17', 5,100,100,''),
52 ( 1,0,'2004-09-18', 7,100,100,''),
53 ( 17,0,'2004-09-27',20,132,100,''),
54 ( 4,0,'2004-09-16',23,132,100,''),
55 ( 86,0,'2004-09-18', 7,196,196,''),
56 ( 11,0,'2004-09-16',16,132,100,''),
57 (140,0,'2004-09-18', 0,100,164,''),
58 ( 2,0,'2004-09-17', 7,132,100,''),
59 (846,0,'2004-09-27',11,132,164,''),
60 ( 1,0,'2004-09-18', 8,132,100,''),
61 ( 22,0,'2004-09-27', 9,164,132,''),
62 (711,0,'2004-09-27', 9,100,164,''),
63 ( 11,0,'2004-09-18', 0,196,132,''),
64 ( 41,0,'2004-09-27',15,196,132,''),
65 ( 57,0,'2004-09-18', 2,164,196,'');
66 SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
67 as date_formatted FROM t2 GROUP BY day ORDER BY day DESC;
68 date date_formatted
69 20040927 27-09-2004
70 20040918 18-09-2004
71 20040917 17-09-2004
72 20040916 16-09-2004
73 SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
74 as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2;
75 date date_formatted
76 20040927 27-09-2004
77 20040918 18-09-2004
78 drop table t2;