SELECT COUNT (*) from
select salary, min(salary) over () min_salary from tab1
WHERE salary> min_salary
Select allOpen in new window
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent
As I a posted in your MAX question: If you think you need to query the table twice, rethink it.
This should return the same results and only access the table once:
Open in new window
Without the data you have, I cannot say if it will return 6 or 15 rows.