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 ...... ??
答案 0 :(得分:4)
SELECT count(P.pID) - 1 as pID_count
FROM Department D, Professor P
WHERE D.dID = ? AND P.dID = D.dID;
答案 1 :(得分:2)
怎么样?
SELECT count(P.pID) - 1
FROM Department D, Professor P
WHERE D.dID = ? AND P.dID = D.dID;
答案 2 :(得分:1)
SELECT count(P.pID)-1
FROM Department D, Professor P
WHERE D.dID = ? AND P.dID = D.dID;