BaşlayınÜcretsiz Başlayın

Numbering rows

The simplest application for window functions is numbering rows. Numbering rows allows you to easily fetch the nth row. For example, it would be very difficult to get the 35th row in any given table if you didn't have a column with each row's number.

Bu egzersiz

PostgreSQL Summary Stats and Window Functions

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Number each row in the dataset.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT
  *,
  -- Assign numbers to each row
  ___ ___ AS Row_N
FROM Summer_Medals
ORDER BY Row_N ASC;
Kodu Düzenle ve Çalıştır