4
Answers

SQL Query for display single records from two records

Jhon ABhu

Jhon ABhu

4y
651
1
my table consists data after research my query looks like this
  1. Select * From TableName join (select event, Max(Date_Time) as maxDate  
  2. FROM TableName group by Event) as t2  
  3. on TableName.Event = t2.event and TableName.Date_Time = t2.maxDate  
  4. UNION  
  5. Select * From TableName join (select event, Min(Date_Time) as minDate  
  6. FROM TableName group by Event) as t2  
  7. on TableName.Event = t2.event and TableName.Date_Time = t2.minDate Order By TablName.Event
through above Query finally got this result.. in this i need single record for event name burry. i have draw table in below i need like that with that two reocrd
 
Answers (4)