I have 2 tables with name [COURSE] and [TEST]. COURSE table having columns ID,Name. [TEST] table contains ID,CourseID(Foriegn key i.e. ID in COURSE table),DATETIME,NUMBERS. example:suppose COURSE table with ID 1,2(only 2 column) and TEST table with 8 numbers of data having different datetime and CourseId 1(3 column),2(6 column)
I want to find the minimum
Name by joining this 2 table the below query giving a 2 output but i want a single query to find the single column??
(SELECT min([DATETIME]) as DATETIME ,[TEST].CourseID,Name
left JOIN [dbo].[COURSE]
ON [dbo].[TEST].CourseID=[COURSE].ID GROUP BY CourseID,Name)