0
What am I doing wrong on this query sql Joining Table exercise?
Having trouble executing this query can anyone help? Thanks! select Students.ID, Students.Firstname, Students.Lastname, Teachers.Lastname, as teacher from students, teachers where Students.TeacherID=Teachers.ID order by students.id
5 Respuestas
+ 5
Tibor Santa In mysql the name of the tables can be case sensitive, it depends on the os used.
Either way, once a syntax is used to call a table or column, the same must be used thereafter.
https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html
+ 4
Roland thanks, I learned something new about MySQL :)
I was not aware that you cannot use the same identifier twice in the same statement with different casing... But this seems to be a particular quirk of MySQL itself.
https://stackoverflow.com/questions/153944/is-sql-syntax-case-sensitive
+ 3
Roland SQL is not case sensitive :)
But you are correct about the comma before "as" is not needed
+ 3
I don't see you use JOIN anywhere ...
+ 1
The table and column are case sensitive.
Be carefull to uppercase and lowercase.
There is no comma before AS Key in the select