Är det möjligt att sammanslå dessa två frågorna på något sätt.
SELECT TOP 90 tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName
FROM tLink
INNER JOIN tCat ON tLink.fCatId = tCat.fId
WHERE tLink.fMode=1
ORDER BY tLink.fDate, tLink.fId;
SELECT COUNT(*) AS intCommentCount FROM tComment WHERE fLinkId=tLink.fId;
SELECT TOP 90 tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName, COUNT(tComment.fLinkId) AS intCommentCount
FROM tLink
INNER JOIN tCat ON tLink.fCatId = tCat.fId
LEFT JOIN tComment ON tLink.fId = tComment.fLinkId
WHERE tLink.fMode=1
GROUP BY tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName
ORDER BY tLink.fDate, tLink.fId;
SELECT TOP 90 tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName, COUNT(tComment.fLinkId) AS intCommentCount
FROM tLink
INNER JOIN tCat ON (tLink.fCatId = tCat.fId)
LEFT OUTER JOIN tComment ON (tLink.fId = tComment.fLinkId)
WHERE tLink.fMode=1
GROUP BY tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName
ORDER BY tLink.fDate, tLink.fId;
SELECT TOP 90 tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName, COUNT(tComment.fLinkId) AS intCommentCount
FROM (tLink
INNER JOIN tCat ON tLink.fCatId = tCat.fId)
LEFT OUTER JOIN tComment ON tLink.fId = tComment.fLinkId
WHERE tLink.fMode=1
GROUP BY tLink.fId, tLink.fLinkUrl, tLink.fLinkName, tLink.fClickCounter,
tLink.fDate, tLink.fCatId, tCat.fName
ORDER BY tLink.fDate, tLink.fId