This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT name, COUNT(*) | |
| FROM absences | |
| GROUP BY name | |
| ORDER BY COUNT(*) DESC | |
| FETCH FIRST 3 ROWS WITH TIES; | |
| name | count | |
| ------------+------- | |
| John Doe | 2392 | |
| Jane Doe | 1960 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| require "thread" | |
| # A writer-preferred read/write lock for Ruby. | |
| # | |
| # Semantics: | |
| # - Multiple threads may hold the read lock concurrently. | |
| # - Only one thread may hold the write lock at a time. | |
| # - While a writer is active, no readers or other writers may proceed. | |
| # - Writer-preferred: once any writer arrives (even if it must wait), |
OlderNewer