Zeic123
Zeic123

Reputation: 53

Limiting SQL Query to Just a Few Results

I get over 1 million results from this query. How do I limit it to just the first 10 that I can test with?

Select id, first_name, last_name
from customers
Where country = 'US'

Upvotes: 0

Views: 78

Answers (1)

JR Kincaid
JR Kincaid

Reputation: 823

Sure! T-SQL

Select TOP 10 id, first_name, last_name

from customers Where country = 'US'

For anything ANSI Compliant see this question which has a similar aim: ANSI SQL version of SELECT TOP 1

Upvotes: 1

Related Questions