Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DOB FROM (SELECT DOB FROM USERS ORDER BY DOB DESC) WHERE ROWID = 6
- SELECT column FROM table ORDER BY column DESC LIMIT 7,10;
- select id from table order by id desc limit 4 ;
- +------+
- | id |
- +------+
- | 2211 |
- | 2210 |
- | 2209 |
- | 2208 |
- +------+
- SELECT yourvalue
- FROM yourtable t1
- WHERE EXISTS( SELECT COUNT(*)
- FROM yourtable t2
- WHERE t1.id <> t2.id
- AND t1.yourvalue < t2.yourvalue
- HAVING COUNT(*) = 3 )
- +------+
- | id |
- +------+
- | 2208 |
- +------+
- select created from (
- select created from (
- select created from user_objects
- order by created desc
- )
- where rownum <= 9
- order by created asc
- )
- where rownum = 1
- select SAL from EMPLOYEE E1 where
- (N - 1) = (select count(distinct(SAL))
- from EMPLOYEE E2
- where E2.SAL > E1.SAL )
- select SAL from EMPLOYEE E1 where
- (N - 1) = (select count(distinct(SAL))
- from EMPLOYEE E2
- where E2.SAL > E1.SAL )
- select SAL from EMPLOYEE E1 where
- (2 - 1) = (select count(distinct(SAL))
- from EMPLOYEE E2
- where E2.SAL > E1.SAL )
- select distinct top n+1 column from table order by column desc
- select distinct top n+1 column from table order by column desc
- SELECT col1 from
- (select col1, dense_rank(col1) over (order by col1 desc) ranking
- from t1) subq where ranking between 2 and @n
- select col1
- from
- ( select col1, dense_rank() over (order by col1 desc) rnk
- from tbl
- )
- where rnk = :b1
- SELECT MIN(q.col1) FROM (
- SELECT
- DISTINCT TOP n col1
- FROM myTable
- ORDER BY col1 DESC
- ) q;
Add Comment
Please, Sign In to add comment