commit 904487fcfb93aadae1c4f33e49a07fea22591582 parent 96d0870ce9fcfe63a2f8ec3fa9b83efc29052d65 Author: AndrewLockVI <andrewlaack1@gmail.com> Date: Sun, 25 Jun 2023 18:42:25 -0500 Completed biggest single number sql problem Diffstat:
| A | biggest-single-number/biggest-single-number.sql | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/biggest-single-number/biggest-single-number.sql b/biggest-single-number/biggest-single-number.sql @@ -0,0 +1,13 @@ +--Find the largest number in a list +--of records where there are no repeats +--of the number +--Time: 800ms Beats: 77.74% + +SELECT MAX(num) AS num +FROM MyNumbers +WHERE num NOT IN ( + SELECT num + FROM MyNumbers + GROUP BY num + HAVING COUNT(*) > 1 +);