打开视图---->新建视图-----> 运行sql ----> 保存
统计地区的愿望数量
sql语句
select user.id AS id,count(userplant.userid) AS amount,user.locationid AS locationid,user->location.name AS locationname from ((userplants userplant left join users us…
首先我们需要通过sql语句查询出相关的表结构的结构 SELECT COLUMN_NAME AS 字段名称,COLUMN_TYPE AS 字段类型,IF(IS_NULLABLENO,否,是) AS 是否必填,COLUMN_COMMENT AS 注释FROM INFORMATION_SCHEMA.COLUMNSWHERE table_schema bs-gdsAND table_name sys_menu;查询的结构如下…