Interviews1 answer
What is the difference between Top 1 and Top 1 1 in SQL Query
1 Answer
Select Top 1 or Top n basically returns the first n rows of data based on the SQL query. Select Top 1 1 or Top n s will return the first n rows with data s depending on the SQL query.
Example: Top 10
1)SELECT TOP 10 FirstName, LastName
FROM [tblUser]
where EmailAddress like 'john%'
2) SELECT TOP 10 'test'
FROM [tblUser]
where EmailAddress like 'john%'
A second will be given the same output as first but the values will be a test
Jenith ThakkarPosted Jan 4, 2019, 1:33 AM EST
