0

How to covert mysql query into mssql query?

SELECT name FROM user LIMIT 5, 10

I have known that mssql don't support 'limit'...

But I have to use limit!

How to covert mysql query into SQL Server query?

2
  • stackoverflow.com/questions/603724/… Commented Aug 7, 2013 at 6:35
  • You need to specify an order criteria. There is a primary key/unique index/unique constraint on this table ? Commented Aug 7, 2013 at 6:47

3 Answers 3

2

Try out this

SELECT * FROM ( 
  SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM sys.databases 
 ) a WHERE a.row > 5 and a.row <= 10

You can achieve your concept.

Sign up to request clarification or add additional context in comments.

Comments

1
select * from 
(select name , ROW_NUMBER() over(order by name) rn from user ) a
where rn > 5 and rn<= 15

Comments

0

There is no way to translate this, but there is a bit of workaround here on SO. Check this out.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.