KBD

Keith Devens .com

Friday, May 9, 2008 Flag waving
Mistakes are as serious as the results they cause. – House (The Mistake – ep 30)

Archive: February 28, 2008

← February 26, 2008February 29, 2008 →

Daily link icon Thursday, February 28, 2008

  1. Be Imba! - the online Character Auditor for World of Warcraft. Fetches your info from the armory and makes suggestions / criticisms of your gear / spec.

       (0) Tags: [World of Warcraft]

'Limit' clause in MSSQL

Solution 1: SQL Server Equivalent To MySQL And PostgreSQL Limit Clause - Joseph Scott’s Blog. Note: assumes unique keys.

SELECT TOP n *
FROM tablename
WHERE key NOT IN (
    SELECT TOP x key
    FROM tablename
    ORDER BY key
)

Solution 2: Finally a LIMIT clause for MS SQL. (Same solution recommended here, with a small explanation.)

select * from (
 select top 10 emp_id,lname,fname from (
    select top 30 emp_id,lname,fname
    from employee
    order by lname asc
 ) as newtbl order by lname desc
) as newtbl2 order by lname asc

Edit: The above is in SQL Server 2k... for 2005 there's a new row_number() function.

← February 26, 2008February 29, 2008 →
May 2008
SunMonTueWedThuFriSat
 123
45678910
11121314151617
18192021222324
25262728293031



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

new⇒Girls, please don't get breast implants

I looked like a 12 yr old boys body​before I got mine and I cant be​happier...

Mel: May 9, 2:57pm

Javascript clone function

?!code:language=javascript

var​parent = { name : "jake", age :​"26"};

...

Jake: May 8, 10:05am

I hate ASP.NET

I am a professional developer in​the USA. My company uses me for​specifical...

David: May 5, 11:37pm

WoW Forums -> Defense after clefthoof

Yes, which is why, like it says​above, the crit cap for druids is​2.6 with ...

Keith: May 5, 4:17pm

Spider solitaire

Hello,
I'm a SS newbie, and I have​a two-suit game that I cannot beat.​Is ...

Amanda: May 4, 10:04pm

Generated in about 0.051s.

(Used 7 db queries)