select
(select count(*) null_cnt from t_menu where type_id is NULL) as null_cnt,
(select count(*) notnull_cnt from t_menu where type_id is not null) as notnull_cnt
查询结果如下:新增一列显示
增加序号
SELECT
@rownum :=@rownum + 1 cno,
x.*
FROM
(SELECT @rownum := 0) a ,t_menu x
Mysql 查询结果新增一列显示查询结果新增一列显示select asselect (select count(*) null_cnt from t_menu where type_id is NULL) as null_cnt,(select count(*) notnull_cnt from t_menu where type_id is not null) as notnull_cnt查询结果如下:新增一列显示增加序号SELECT @rownum :=@rownum + 1