Hi @Farhan Sabir ,
Welcome to the microsoft TSQL Q&A forum!
The WHERE clause will return all rows that meet the conditions. The parameter IN will also return all rows that meet the condition. In other words, all rows that meet the conditions behind them will be returned.
As pituach said, it may be that your JOIN statement filters out other rows. Please try the following code first to see if the JOIN sentence is incorrectly filtered:
select
[Station Description]
[Transaction Code],
[DateTime Passed]
from [Tracking_Server_DB].[dbo].TS_Station as stn
inner join [Tracking_Server_DB].[dbo].[Checkpoint Movement] as mv
on stn.[Transaction Code] = mv.[Transaction Code]
--where stn.[Station Description] IN ('T0011', 'M250', 'T0011')
--and [DateTime Passed] = '2021-08-26 22:49:19.000'
order by [DateTime Passed] desc
If you have any question, please feel free to let me know.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.