Mysql 查询结果新增一列显示
查询结果新增一列显示
select as
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