我正在尝试为一个项目组获取一些图像,但似乎无法让乘法与分配的别名一起使用。我已经尝试了下面的脚本并进行了一些修改,但我尝试过的每件事都行不通。
SELECT s.pid AS 'ID',
CONCAT_WS(', ', p.lastname, p.firstname) AS 'Name',
CONCAT(s.date, ' ', s.time) AS Serviced,
p.institution AS Facility,
s.description AS 'description title',
(SELECT COUNT(*)
FROM series se
WHERE se.studyid = s.id)
AS numseries,
(SELECT COUNT(*)
FROM image i
WHERE i.seriesid = se.id)
AS serimages,
numseries * serimages AS 'Number of Images'
FROM product p,
series se
JOIN
study s
ON s.pid = p.id
GROUP BY s.id
ORDER BY Serviced DESC