narasiman rao

narasiman rao

  • NA
  • 519
  • 745.6k

How to pass mutiple city id in sql query

Aug 26 2016 2:37 AM
My sql query as follows

select DISTINCT date_TripDate AS TripDate,traveltype.varchar_TravelTypeCode AS TripType,contactss.Value as Mobilenumber,from [OneC_988].[dbo].[988_Details_VehicleRequest] request join [OneC_988].[dbo].[988_Details_VehicleTrip] trip on request.int_VehicleRequestID=trip.int_VehicleRequestID
and int_CityID ='1'

When i run the above query output as follows

Tripdate TripType Mobilenumber int_CityID

26th aug 16 IN 9878778878 1
26th aug 16 IN 9949949990 1
26th aug 16 IN 9878778878 1



i want to pass both INT_CityID 1 and 2 in the above sql query to get output as follows

Tripdate TripType Mobilenumber int_CityID

26th aug 16 IN 9878778878 1
26th aug 16 IN 9949949990 1
26th aug 16 IN 9878778878 1

28th aug 16 IN 9878778878 2
28th aug 16 IN 9949949990 2
28th aug 16 IN 9878778878 2

Answers (3)