Gcobani Mkontwana

Gcobani Mkontwana

  • 560
  • 1.9k
  • 412.2k

How to use where clause in sql server?

Aug 26 2021 8:54 PM

Hi team

 

I am using where clause and my return results i get one value record list, is there a way within my IN statement i can also get other values by using where clause statement. See below image results.

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

 

In summary want to get other values('T0011', 'R600', 'M000'), currently im receiving M250 only, hope make sense now.


Answers (3)