Files
oracle/tpt/demos/ordering_antijoin.sql

13 lines
375 B
MySQL
Raw Normal View History

2026-03-12 21:23:47 +01:00
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
SELECT * FROM (
select rownum r from
all_users where username like 'S%'
order by r desc
)
WHERE r NOT IN (select /*+ HASH_AJ(a) */ rownum FROM all_users a where rownum<= 2)
and rownum <= 5
/