venkat

venkat

  • NA
  • 138
  • 51.7k

Not matched records in sql using joins

Aug 29 2018 5:38 AM
Hi all ,
Below i have two tables , 1st table contain 12 records and second one contain 8 records. now i need to  get remain 4 records only not with 8 records using joins in sql. i have tried below query  but still am not getting .please help on this
 
Select DISTINCT it.ShapeName,it.Intervalyear,it.IntervalMonth from @yearTable yt
left JOIN @IntervalTable it on yt.NumDays=it.IntervalNumDays
where  it.Intervalyear is null and it.IntervalNumDays='2018'
 
 

Answers (6)