Find consecutive days with gaps and islands, rank the longest streak per user, and define a current streak using the right business date.
Get the Second Row From a Table in SQL Server
To get the second row from a table, first decide what second means, because a table has no order until you give it one. This post builds a small demo and compares ROW_NUMBER, OFFSET and FETCH, and TOP inside TOP. It also covers every second row, the second row in each group, ties and the cost of each method.
Does GROUP BY Sort Results? Only ORDER BY Guarantees It
Does GROUP BY sort the rows it returns? No: only ORDER BY guarantees an order. This post builds a small demo, shows one GROUP BY query returning two different orders, and reads the plans that explain why.
MariaDB – MySQL – Show Engines to Display All Available and Supported Engine
I inspect each Supported Engine with SHOW ENGINES on MariaDB. A customer using MariaDB alongside SQL Server asked about this list.







