Skip to content
Advertisement

Incorrect syntax near the keyword ‘right’

i am very new to SQL, spent hours searching but all the articles point to more or less same

Bellow is my code, but honestly not sure what am i doing wrong here.

I want to join both tables via ID, keep the id from left and take other parameters from right table user_private_store_items

i get Incorrect syntax near the keyword ‘right’

Advertisement

Answer

Just put the where clause after the joins:

Notes:

  • table aliases make the query easier to read and understand. I modified you query to use them

  • you would need to prefix store_type in the where clause with the table it belongs to, to avoid ambiguity

  • avoir select *; better enumerate all the columns that you want to select

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement