1

Is there a way to write a SQL query that looks in a Data Extension field for a contains X value

I have a Data Extension that has a Description field and i want to write a query that extracts any record that contains the word geo-spatial

I have tried Like but it didnt work Example of query i have:

Select 
        i.[subscriber key] as subscriber_key
       ,i.[First Name]
       ,i.[Last Name]
       ,c.Description
from 
      ENT.Case_salesforce_2 as c 
      Left Outer Join contact i on i.[Subscriber Key] = c.ContactId
where 
     c.Description like 'geo-spatial'

Example of the data in the field is: Requests to change geo-spatial block information. Please close this case when the block has been updated.........

I cant do an exact match as the copy changes for each submission but always will have geo-spatial in the records i need Thanks

2

You are not using the LIKE operator correctly. You need to use the % before and after your string 'geo-spatial'.

The % replaces all characters before and after 'geo-spatial'.

Try this query:

Select i.[subscriber key] as subscriber_key 
       , i.[First Name] 
       , i.[Last Name] 
       , c.Description 
from ENT.Case_salesforce_2 as c 
Left Outer Join contact i on i.[Subscriber Key] = c.ContactId 
where c.Description like '%geo-spatial%'
| improve this answer | |
  • Thanks very much, it worked great – Andyw Jun 5 '19 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.