I have the following query:
Select
Count(Distinct Case When Play.Uuid Like ('i~%') Then Tap.Player_Id End) As Tapjoy_Ios
From
Player_Tapjoy Tap
Inner Join
Player Play
On
Tap.Player_Id = Play.Player_Id
Where
Trunc(Tap.Create_Dtime) >= To_Date('2012-Jan-01','yyyy-mon-dd')
I want to add another like constrain so that the result comes out where play.uuid like (‘i~%’ or ‘ti~%’)..but that doesn’t seem to work. How could I implement this?
You need two full
LIKEclauses connected by a logicalOR, each having both the left and right sides of theLIKEkeyword (column on the left, string value on the right).You could also do this with a single
REGEXP_LIKE, using the regular expressiong^t?i~.+:^is the start of the stringt?is an optionalti~is literal.+is any remaining characters, equivalent to%in a regularLIKE.