Jump to content


Photo

MS SQL Query


  • Please log in to reply
3 replies to this topic

#1 ottomatic

ottomatic
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 October 2005 - 03:20 PM

I know that you can do a LIMIT in mysql statements but you can't do that in MS SQL. Does anyone know an alternative to the LIMIT command in MS SQL?



#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 23 October 2005 - 01:01 PM

SELECT TOP 10 * FROM tablename
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 Munchen

Munchen
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 21 November 2005 - 11:06 AM

Take a look at [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=76155\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=76155[/a] how I did it.
-Munchen
Denmark

#4 raul

raul
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 24 February 2006 - 08:56 AM

[!--quoteo(post=306053:date=Oct 13 2005, 05:20 PM:name=ottomatic)--][div class=\'quotetop\']QUOTE(ottomatic @ Oct 13 2005, 05:20 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I know that you can do a LIMIT in mysql statements but you can't do that in MS SQL. Does anyone know an alternative to the LIMIT command in MS SQL?
[/quote]

U could take a look at [a href=\"http://ionescuraul.users.phpclasses.org/browse/package/2832.html\" target=\"_blank\"]http://ionescuraul.users.phpclasses.org/br...ckage/2832.html[/a] :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users