Urgent:2nd highest salary without using a subquery in sql
-
I want an output of 2nd highest salary without using a subquery in sql server 2005.I'm writting the following query: select empno, ename, job, sal, deptno from (select t.*, row_number() over(order by t.sal desc) seq from emp t) y where y.seq = 2 But when I run this query, I get an error: 'ROW_NUMBER' is not a recognized function name.
-
I want an output of 2nd highest salary without using a subquery in sql server 2005.I'm writting the following query: select empno, ename, job, sal, deptno from (select t.*, row_number() over(order by t.sal desc) seq from emp t) y where y.seq = 2 But when I run this query, I get an error: 'ROW_NUMBER' is not a recognized function name.
Using "urgent" in a subject line or forum post is considered rude.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Using "urgent" in a subject line or forum post is considered rude.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
In some cases.....Very rude!! Particularly if it sounds like homework!!!
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
In some cases.....Very rude!! Particularly if it sounds like homework!!!
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
Adeel Chaudhry wrote:
it sounds like homework!!
Yes, it does. School must be back in session...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon