0

I'm trying to write a SQL query in a marketing cloud automation studio activity

SELECT
  *
FROM
  [table 1]
WHERE
  [field 1] IN (
    'a2F6F000002WUVmUAO',
    'a2F6F000002WTqbUAG',
    'a2F6F000002WT8DUAW',
    'a2F6F000002WT9QUAW',
    'a2F6F000002WSghUAG',
    'a2F6F000002WTAKUA4',
  )

However I keep getting a Incorrect syntax near ')'. error.

Does anyone know how to fix this error? I can't seem to find anything wrong with the syntax of my sql

  • 1
    Since you only have 1 "item" in your "IN" list, you may have to remove that extra comma. (You only have one comma in the whole query, so it should be pretty easy to determine which one I'm referencing!) – Helpful Mar 8 '18 at 0:52
  • Hey thanks for responding. I actually edited the original query, which had alot more values. I've edited the original post with a new query with additional values and its still showing a ')' error during syntax validation – Mark Koh Mar 8 '18 at 0:59
5

Remove the last , before the bracket. It's the last item and doesnt need to be followed by a ,

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.