• Skip to primary navigation
  • Skip to content
  • Skip to footer
Thomas Ngo's Developer Journal Thomas Ngo's Developer Journal
  • Home
  • Journal
  • Tags
  • About
    Thomas Ngo

    Thomas Ngo

    Software Engineer

    • Stanton, California
    • Email
    • GitHub
    • Resume

    SQL problem - Consecutive Numbers

    February 25, 2024 less than 1 minute read

    Page Navigation

    • Problem
    • Query

    Problem

    problem-180

    Query

    SELECT DISTINCT
        l1.num AS ConsecutiveNums
    FROM
        Logs AS l1,
        Logs AS l2,
        Logs AS l3
    WHERE 
        l1.num = l2.num AND l1.num = l3.num AND l1.id = l2.id - 1 AND l1.id = l3.id - 2
    

    Tags: SQL

    Updated: February 25, 2024

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Problem of The Day: Maximize the Number of Target Nodes After Connecting Trees II

    May 28, 2025 1 minute read

    Problem Statement

    Problem of The Day: Set Matrix Zeroes

    May 27, 2025 1 minute read

    Problem Statement

    Problem of The Day: Set Matrix Zeroes

    May 20, 2025 1 minute read

    Problem Statement

    Problem of The Day: Simplify Path

    May 19, 2025 less than 1 minute read

    Problem Statement

    • Follow:
    • GitHub
    • LinkedIn
    © 2025 Thomas Ngo.