+ 2
What's wrong in my code? ZOO
INSERT into Animals(name, type, country_id) VALUES(Slim, Giraffe, 1) SELECT Animals.name,Animals.type, Countries.country FROM Animals INNER JOIN Countries on Animals.country_id = Countries.id ORDER by Countries.country ;
5 Antworten
+ 5
Thanks both of you... ☺☺
+ 2
INSERT into animals (name,type,country_id) VALUES ('Slim','Giraffe',1);
SELECT a.name, a.type, c.country FROM animals as a INNER JOIN countries AS c
ON a.country_id = c.id ORDER BY id DESC;
+ 2
Add strings into quotes ' '
Missing ; at the end of first query
And specify countries in descending order I'd.
+ 2
Only two mistakes in my code first is quotes and second terminated symbol (;)
Thanks for helping me
+ 1
Your question is not quite clear. While inserting an element, if it's a string/varchar then you should write 'Slim' and 'Giraffe'.