Комментарии:
SELECT DISTINCT Salary as EighthDistinctHighestSalary
FROM Employee
ORDER BY Salary DESC
LIMIT 1 OFFSET 7;
by changing the offer we can obtain the nth number
This fool guy is teaching us with rownum, rownum actually does not work in mysql
Ответитьwith salary_Details as (
select emp_name, emp_sal, dense_rank () over ( order by emp_sal desc) as rank from employee)
select * from salary_Details
where rank = 3;
alternative of rownum in MySQl ?
Ответитьfacing problem please provide the solution the screen is showing like this
Incorrect syntax near the keyword 'where'.
select distinct salary from empdetail order by salary desc
where rownum<=3;
minus
select distinct salary from empdetail order by salary desc
where rownum<=2;
copy and paste the command in the description section so that it will be helpful
ОтветитьJust order by desc and use LIMIT 1 and OFFSET N?
ОтветитьExplained well 💫💫💫
ОтветитьSELECT * FROM Employee WHERE sal =
(
SELECT MIN(sal) FROM Employee
WHERE sal IN (
SELECT DISTINCT TOP N
sal FROM Employee
ORDER BY sal DESC
)
)
Limit N,N-1; ??
ОтветитьWhy can we directly use the query without like an inline kind of query..i mean why cant we use select distinct sal from emp order by sal desc where rownum<=3 minus select distinct sal from emp order by sal desc where rownum<=2;
Ответитьcan't we directly use rownum=3 in the 1st query?
ОтветитьWhy the only thing i can focus on is his 'yanth' highest salary nd his strong tamil accent.
Ответитьgetting error minus identifier is not valid at this position in the query,
SELECT * FROM(SELECT DISTINCT MARKS FROM tbl_studentData order by MARKS desc )
where rownum <=3
minus
SELECT * FROM(SELECT DISTINCT MARKS FROM tbl_studentData order by MARKS desc )
where rownum <=2
Recommend
ОтветитьAre these questions are good enough for 2 years of experiance employee in sql
ОтветитьWe can use this "Select * from emp( Select rownum r, distinct(sal) from emp order by desc) where r = 3;"
ОтветитьMan u gave such a general startegy 👍 so awesome
For mysql users
U can use TOP clause in place of rownum
select min(sal) from(select distinct sal from emp order by sal desc)
where rownum<=3;
without minus we can use it in this way
I would wrap it into another sub-query and assign rownum alias... then in outer query you could just check for equals
ОтветитьAwesome explained sir
ОтветитьCan we use NOT IN instead of MINUS?
ОтветитьGreate sir, it can be done by using = operator instead of minus operator.
Ответитьthis is a great content, have been looking such a content for days
Ответитьwhat's the difference between select * from (select distinct Sal from Emp order by sal desc) vs select distinct Sal from Emp order by sal desc???
ОтветитьWe can use the below query
select max(sal) from(select distinct Sal from Emp order by sal desc) where rownum<= 3
Thanks
ОтветитьWhat's the difference between highest salary and nth highest salary?
ОтветитьAny online good platform for sql command ?
ОтветитьIt's very helpful
ОтветитьThanks
Ответитьimprove the audio quality please
ОтветитьCan't we write rowno=3
Ответить