Added some indices to database and more SQL simplification

This commit is contained in:
2023-02-15 14:25:45 +01:00
parent 6df7a3f6a8
commit 808ae831bf
7 changed files with 46 additions and 71 deletions

View File

@@ -33,10 +33,10 @@
// setup asset
// build query
$query = "SELECT
COUNT(asset.asset_id) AS asset_counter
COUNT(asset_id) AS asset_counter
FROM
asset";
// run query
$assets = $db->db_select($query);
@@ -46,7 +46,7 @@
// setup location
// build query
$query = "SELECT
COUNT(location.location_id) AS location_counter
COUNT(location_id) AS location_counter
FROM
location";
@@ -59,7 +59,7 @@
// setup node
// build query
$query = "SELECT
COUNT(node.node_id) AS node_counter
COUNT(node_id) AS node_counter
FROM
node";
@@ -72,7 +72,7 @@
// setup subnet
// build query
$query = "SELECT
COUNT(subnet.subnet_id) AS subnet_counter
COUNT(subnet_id) AS subnet_counter
FROM
subnet";
@@ -85,7 +85,7 @@
// setup vlan
// build query
$query = "SELECT
COUNT(vlan.vlan_id) AS vlan_counter
COUNT(vlan_id) AS vlan_counter
FROM
vlan";