我有这个Select,它计算表Local中localName
的数量,其中indIP
等于表Segment中的indIP
并按segmentName
SELECT COUNT(localName) FROM Local L, Segment S WHERE L.indIP = S.indIP GROUP BY segmentName;
COUNT(localName)
- 2
- 1
- 3
现在我想将此数字放在表Segment的nbRooms
列的右行,并显示如下更新:
UPDATE Segment SET nbRooms = ***
示例:
SELECT * FROM Segment
indIP | segmentName | nbRooms
- 3---------first ----------------2
- 4---------second------------1
- 5---------third----------------3
你能帮我吗?
答案 0 :(得分:1)
您可以使用相关子查询:
$this->context->controller->registerJavascript(
'three.js',
'https://ajax.googleapis.com/ajax/libs/threejs/r84/three.min.js',
['position' => 'bottom', 'priority' => 100, 'server' => 'remote']
);