0

Why do I always get a syntax error on the following inner join:

SELECT 'myapp_instagram_shop'.id 
FROM 'myapp_instagram_shop'  
INNER JOIN  'myapp_instagram_shop_picture' 
    ON  'myapp_instagram_shop'.id =  'myapp_instagram_shop_picture'.shop_id;

Error is:

1064 - You have an error in your SQL syntax; check the manual that corresponds to 
your MySQL server version for the right syntax to use near ''myapp_instagram_shop'
INNER JOIN 'myapp_instagram_shop_picture' ON 'sh' at line 1
1
  • 2
    wrap table names in ` - not quotes - `myapp_instagram_shop` same goes for pseudonyms. `myapp_instagram_shop`.id Commented Sep 26, 2013 at 2:00

1 Answer 1

2

try

SELECT myapp_instagram_shop.id FROM myapp_instagram_shop  INNER JOIN  myapp_instagram_shop_picture ON  myapp_instagram_shop.id = myapp_instagram_shop_picture.shop_id;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.