LIR: Jax. I think you can kinda "trick" it into generating a subquery like this using CONCATENATE
Posted by
kilboooo (aka kkuphal)
Oct 28 '08, 07:49
|
SELECT helpdesk_escalatedcount.[Taken By], helpdesk_notescalatedcount.LevelOneCalls, helpdesk_escalatedcount.LevelTwoCalls, [LevelTwoCalls]/[LevelOneCalls] AS PercentEscalated,
CONCATENATE("SELECT TOP 1 COUNT(application) FROM othertable WHERE name = " & helpdesk_escalatedcount.[Taken By] & " ORDER BY COUNT(application) DESC") as appcount
FROM helpdesk_escalatedcount
INNER JOIN
helpdesk_notescalatedcount ON helpdesk_escalatedcount.[Taken By] = helpdesk_notescalatedcount.[Taken By];
|
Responses:
|