Nanda's Blog

Share a smile, Share information

Query LIMIT pada SQL Server 2008 February 23, 2011

Filed under: MySQL,Pemrograman,SQL Server — nanda @ 7:05 pm

Pada MySQL untuk membuat sebuah Query LIMIT maka digunakan syntax :

SELECT * FROM namatabel LIMIT 2

Lalu bagaimana query pada SQL Server(2008)??

nah Query yang digunakan adalah :

SELECT TOP 2 * FROM namatabel WHERE field NOT IN (SELECT TOP 5 FROM namatabel)
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s