Problem med select
Hey,Jeg får en fejl ved kørsel af følgende sproc:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[usp_HitLog_GetSessionIDs]
@Since DATETIME,
@Until DATETIME
AS
BEGIN
SET NOCOUNT ON;
SELECT SessionID, Logged
FROM tblHitLog
WHERE Logged > @Since
AND Logged < @Until
GROUP BY SessionID
ORDER BY Logged DESC
END
Fejl:
Msg 8120, Level 16, State 1, Procedure usp_HitLog_GetSessionIDs, Line 9
Column 'tblHitLog.Logged' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Hvad er der galt?