Yelp interview question

What command would you use to retrieve one row of data from a table using SQL?

Interview Answer

Anonymous

17 Nov 2011

There are a few ways to select a row from a table using SQL, but as long as you're using SQL 2008 or later the idea is to use the format: SELECT ... FROM ... WHERE ... ORDER BY ... FETCH FIRST n ROWS ONLY. The '...'s would be replaced with the appropriate locations of the data, and 'n' would be replaced with the number of rows desired.

1