Search code examples
syntaxsyntax-errormysql-workbenchsakila-database

SELECT * FROM sakila.actor; where first_name =TOM?


What is correct MY SQL syntax for to get the First_name = TOM from Sakila database? I am writing this syntax but getting wrong answer

SELECT * FROM sakila.actor; where first_name = TOM

But getting error message like below:

11:10:05 WHERE first_name = "TOM" Error Code: 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 'WHERE first_name = "TOM"' at line 1 0.000 sec


Solution

  • remove the semi-colon before the where clause Use the below query

    SELECT * FROM sakila.actor WHERE first_name = 'TOM'