0
SELECT [DatapointID]
,[AssetID]
,[DatapointID]
,[SourceTag]
,'-' + [TimeStep] + [TimeStepValue] AS TimeStep
,[DataRetrievalInterval] + [DataRetrievalIntervalValue] AS [RetInterval]
,NULL AS DatapointDate
,NULL AS DatapointValue
,0 As DataFlagID
,DateADD(-1, d @SearchDateEnd) + @SearchTimeEnd DateDataGrabbed
,GetDate() DateTimeAddedtoDB
FROM [dbo].[tblTSS_Assets_Datapoints]
Where AssetID = 204
Select DatapointDate, SUM(DataPointValue) as DataPointValue From @temp
GROUP BY DatapointDate
ORDER BY DatapointDate
첫 번째 선택 쿼리 내가 최종 결과는 그러나 대신 DatapointDate으로 NULL이어야 할 것입니다 내가 결합해야 두 가지 선택 쿼리를 .... 가지고 DatapointValue @ temp의 값을 원합니다.
어떻게해야합니까?