Essentially I want to create a view in mySQL (phpmyAdmin) that queries a table called Equipment for a date range >=2018-12-1.
This is currently what I have, it is what is wrong with my syntax?
CREATE VIEW "Equipment_Date" AS SELECT * FROM "Equipment"
WHERE "Ship_Del_Date" >= 2018-12-1;
2
Answers
Use these to specify databases, tables and columns: `
And not these: “
Or simply just don’t use any of these, if not necessary.
Then your SQL query will probably look like this:
CREATE VIEW Equipment_Date AS SELECT * FROM Equipment WHERE Ship_Del_Date >= 2018-12-1;
Below query should work provided Ship_Del_Date column has datatype as DATETIME.
Use backticks instead of single quotes to enclose the table,column names only when the names are from mysql reserved keywords.