Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ee9237e0
Commit
ee9237e0
authored
Jul 05, 2003
by
Sinisa@sinisa.nasamreza.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
missing test case for DISTINCT .. LEFT ..
parent
5fb59b2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+9
-0
mysql-test/t/distinct.test
mysql-test/t/distinct.test
+7
-0
No files found.
mysql-test/r/distinct.result
View file @
ee9237e0
...
@@ -419,3 +419,12 @@ SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
...
@@ -419,3 +419,12 @@ SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
a b
a b
1 4
1 4
DROP TABLE IF EXISTS t1,t2;
DROP TABLE IF EXISTS t1,t2;
CREATE table t1 ( `id` int(11) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`id`)) TYPE=MyISAM AUTO_INCREMENT=3 ;
INSERT INTO t1 VALUES (1, 'aaaaa');
INSERT INTO t1 VALUES (3, 'aaaaa');
INSERT INTO t1 VALUES (2, 'eeeeeee');
select distinct left(name,1) as name from t1;
name
a
e
drop table t1;
mysql-test/t/distinct.test
View file @
ee9237e0
...
@@ -273,4 +273,11 @@ CREATE TABLE t2 (a int primary key, b int, c int);
...
@@ -273,4 +273,11 @@ CREATE TABLE t2 (a int primary key, b int, c int);
INSERT
t2
VALUES
(
3
,
4
,
5
);
INSERT
t2
VALUES
(
3
,
4
,
5
);
SELECT
DISTINCT
t1
.
a
,
t2
.
b
FROM
t1
,
t2
WHERE
t1
.
a
=
1
ORDER
BY
t2
.
c
;
SELECT
DISTINCT
t1
.
a
,
t2
.
b
FROM
t1
,
t2
WHERE
t1
.
a
=
1
ORDER
BY
t2
.
c
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
CREATE
table
t1
(
`id`
int
(
11
)
NOT
NULL
auto_increment
,
`name`
varchar
(
50
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
`id`
))
TYPE
=
MyISAM
AUTO_INCREMENT
=
3
;
INSERT
INTO
t1
VALUES
(
1
,
'aaaaa'
);
INSERT
INTO
t1
VALUES
(
3
,
'aaaaa'
);
INSERT
INTO
t1
VALUES
(
2
,
'eeeeeee'
);
select
distinct
left
(
name
,
1
)
as
name
from
t1
;
drop
table
t1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment