Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> set sql_mode='';
- Query OK, 0 rows affected (0.00 sec)
- mysql>
- mysql> drop table if exists t,s;
- Query OK, 0 rows affected (0.01 sec)
- mysql> drop view if exists t,s;
- Query OK, 0 rows affected, 2 warnings (0.00 sec)
- mysql> create table t (a int primary key) engine=innodb ;
- Query OK, 0 rows affected (0.01 sec)
- mysql> insert into t values(1),(2),(3),(4);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
- mysql> analyze table t;
- +--------+---------+----------+----------+
- | Table | Op | Msg_type | Msg_text |
- +--------+---------+----------+----------+
- | test.t | analyze | status | OK |
- +--------+---------+----------+----------+
- 1 row in set (0.00 sec)
- mysql>
- mysql> create table s(b int auto_increment primary key,c int,d int,key(c))engine=innodb;
- Query OK, 0 rows affected (0.01 sec)
- mysql> insert into s(c) values(1),(2),(3),(4);
- Query OK, 4 rows affected (0.00 sec)
- Records: 4 Duplicates: 0 Warnings: 0
- mysql> analyze table s;
- +--------+---------+----------+----------+
- | Table | Op | Msg_type | Msg_text |
- +--------+---------+----------+----------+
- | test.s | analyze | status | OK |
- +--------+---------+----------+----------+
- 1 row in set (0.00 sec)
- mysql>
- mysql> select a,d from t left join s on c=a;
- +---+------+
- | a | d |
- +---+------+
- | 1 | NULL |
- | 2 | NULL |
- | 3 | NULL |
- | 4 | NULL |
- +---+------+
- 4 rows in set (0.00 sec)
- mysql> select a,group_concat(d)q from t left join s on c=a;
- +---+------+
- | a | q |
- +---+------+
- | 1 | NULL |
- +---+------+
- 1 row in set (0.00 sec)
- mysql> select a,group_concat(d)q from t left join s on c=a group by a;
- +---+------+
- | a | q |
- +---+------+
- | 1 | NULL |
- | 2 | NULL |
- | 3 | NULL |
- | 4 | NULL |
- +---+------+
- 4 rows in set (0.00 sec)
- mysql>
- mysql> set sql_mode='only_full_group_by';
- Query OK, 0 rows affected (0.00 sec)
- mysql>
- mysql> select a,d from t left join s on c=a;
- +---+------+
- | a | d |
- +---+------+
- | 1 | NULL |
- | 2 | NULL |
- | 3 | NULL |
- | 4 | NULL |
- +---+------+
- 4 rows in set (0.00 sec)
- mysql> select a,group_concat(d)q from t left join s on c=a;
- ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
- mysql> select a,group_concat(d)q from t left join s on c=a group by a;
- +---+------+
- | a | q |
- +---+------+
- | 1 | NULL |
- | 2 | NULL |
- | 3 | NULL |
- | 4 | NULL |
- +---+------+
- 4 rows in set (0.00 sec)
- mysql>
- mysql> select version();
- +------------------+
- | version() |
- +------------------+
- | 5.0.96-community |
- +------------------+
- 1 row in set (0.00 sec)
- mysql>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement