发布网友 发布时间:2022-04-23 16:58
共2个回答
热心网友 时间:2023-10-09 23:03
mysql> CREATE TABLE test1111 (
-> id int
-> );
Query OK, 0 rows affected (0.05 sec)
mysql>
mysql> INSERT INTO test1111 values(1);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO test1111 values(3);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO test1111 values(5);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT
-> COUNT(1) AS `行数`,
-> GROUP_CONCAT(cast(id as char)) AS `列表`
-> FROM
-> test1111;
+------+-------+
| 行数 | 列表 |
+------+-------+
| 3 | 1,3,5 |
+------+-------+
1 row in set (0.00 sec)
热心网友 时间:2023-10-09 23:03
没有这样的语句。追问mysql> select count(*) as c, group_concat(id) as cid from user;
我自己找到了,就是这个MYSQL语句 你可以试试 ,也谢谢了