Window function di SQL Server: RANK, LAG, dan LEAD
Bandingkan baris dengan baris sebelum dan sesudahnya tanpa self join yang rumit.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.
Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.
Bandingkan baris dengan baris sebelum dan sesudahnya tanpa self join yang rumit.
Bandingkan cara paging modern OFFSET FETCH dengan pendekatan lama memakai TOP dan subquery.
SQL databases store raw values, but real reports rarely display them exactly as stored. Names may need to be capitalized, prices rounded, and dates formatted in a friendlier way. SQL provides built-in functions that transform values directly inside a query, so the database returns exactly what your application or report needs. In this tutorial, you […]
A SELECT statement is not limited to returning columns exactly as they are stored. You can compute new values on the fly — the total price of an order line, a discount, a tax amount, the age of a record, or the concatenation of a first and last name. These calculations happen inside the database […]
When you write SQL queries, the column names in your result often come straight from the table definition. Names such as unit_price or order_date are useful in the database, but they may look technical in a report, or they may collide when you join two tables that both contain a column called id. SQL solves […]
When you filter rows in SQL, you often need to match a value against a list of options, check whether it falls within a range, or exclude rows that satisfy a condition. Chaining many AND/OR comparisons for these cases quickly becomes hard to read. SQL provides three operators — IN, BETWEEN, and NOT — that […]
Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.
Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.