SELECT count(P.pID)
FROM Department D, Professor P
WHERE D.dID = ? AND P.dID = D.dID;

我想从 count(P.pID) 的任何结果中减去“1”。例如,如果 P.pID 的值为 10,它将输出 9... ??

最佳答案

SELECT count(P.pID) - 1 as pID_count
FROM Department D, Professor P
WHERE D.dID = ? AND P.dID = D.dID;

10-08 15:53