I am trying to create a VIEW from one databse to another, they are both on the same SQL server.
CREATE VIEW mdl_role_assignments
AS
SELECT *
FROM the-db.mdl_role_assignments
Any ideas as to why i cant get this working.
I think its the hyphen in ‘the-db’, but i need to use this the db is already used.
(Was named by someone else, i would use underscore)
ERROR:
#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 ‘-db.mdl_role_assignments’ at line 4
You could try square brackets to reference complicated names in SQL e.g.
or backticks