Mangesh barmate

Mangesh barmate

  • NA
  • 118
  • 135.8k

How to use like operator in where condition ?

Oct 4 2012 4:24 AM

Hi,
I have following query which works properly...
select distinct als.sytem_no,
adm.firstName, + ' '+ adm.lastName as 'Name',
acs.*,als.*
 from ac_storeKeys acs inner join ac_alarmSystems als
 on acs.storeId=als.storeId
inner join ac_districts T
on  acs.storeId='110'
inner join ac_districtManagers adm on adm.districts = T.district
--where acs.storeId='110'
where T.stores like '%110%'

But when i im changing where condition to where T.stores like '%0%'

It gives me all stores matches which having 0, here i only want to match 0 store id if it does.

Any apporach for this...

Answers (1)