基于一个表employees
,我在我的 MySQL 数据库中创建了一个视图,名为Employees_by_gender
:
select count(gender_id) AS "Number of Employees",gender_id AS "Gender" from employees group by gender_id;
mysql> select * from Employee_by_gender;
+--------+---------------------+
| Gender | Number of Employees |
+--------+---------------------+
| 1 | 3890 |
| 2 | 1087 |
+--------+---------------------+
如何在客户端表中呈现此数据库视图的输出?我一直在使用“dataTables bootstrap rails”来渲染所有正常的表格。
如何在类似表格的显示中获取这些数据?