0

As the title suggests, if I try and write a query like:

SELECT * 
FROM TableA
LEFT JOIN TableB
ON TableA.Field = TableB.Field

I get an error saying

An error occurred while checking the query syntax. Errors: 'SELECT * ' is not allowed if you use JOINs. Please specify all the column names you want to select

I know this can be done in SQL. Is this a marketing cloud limitation? Is there another way around this without having to type out every column in the query?

1
  • 2
    You can drag and drop the source data extension from the list on the left, it will then populate all the available fields into the query
    – zuzannamj
    Oct 21, 2020 at 6:00

1 Answer 1

3

Yes, you are NOT allowed to use * while using joins in SFMC SQL activity.

And to answer your second question, YES there is a easy way of doing this.

You can just DRAG n DROP the DataExtension in the place of *

Please find the below illustration video link below. https://i.imgur.com/A7eicPz.gif

enter image description here

3
  • 1
    that. also, you want to avoid it. As it will only respect fields present at time of its creation, and will "lose track" of changes to the DE made later, making maintenance no fun. Oct 21, 2020 at 6:35
  • @JonasLamberty agreed! Thanks for sharing your inputs. Oct 21, 2020 at 7:03
  • Thanks for the drag and drop method. @Jonas I have also run into the issue of SELECT * "losing track" of new fields. However, I think that simply editing the query and resaving it (so it validates again) fixes the problem.
    – Ben
    Oct 21, 2020 at 21:39

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.