How to write a (MySQL) “LIMIT” in SQL Server?

LIMIT does not work in T-SQL. Use TOP instead:

SELECT TOP(1) * FROM tableEating WHERE person = '$identity';

As Aaron says, you also need an ORDER BY if you don’t want to get an arbitrary row.

Leave a Comment