Skip to content

Commit 691eff9

Browse files
authored
Merge branch 'Baeldung:main' into main
2 parents e47e9c4 + 277080a commit 691eff9

File tree

349 files changed

+1998
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+1998
-179
lines changed

sql-queries-7/remove-duplicate-row-in-sql/identifying-duplicates.sql renamed to data-manipulation/remove-duplicates/identifying-duplicates.sql

File renamed without changes.

sql-queries-7/remove-duplicate-row-in-sql/removing-duplicate-row-without-unique-identifier-setup.sql renamed to data-manipulation/remove-duplicates/removing-duplicate-row-without-unique-identifier-setup.sql

File renamed without changes.

sql-queries-7/remove-duplicate-row-in-sql/using-internal-ctid.sql renamed to data-manipulation/remove-duplicates/using-internal-ctid.sql

File renamed without changes.

sql-queries-7/remove-duplicate-row-in-sql/using-temporary-table.sql renamed to data-manipulation/remove-duplicates/using-temporary-table.sql

File renamed without changes.

sql-queries-4/store-decimal-values/create-order-schema.sql renamed to data-manipulation/store-decimal-values/create-order-schema.sql

File renamed without changes.

sql-queries-4/store-decimal-values/insert-value-within-decimal-range.sql renamed to data-manipulation/store-decimal-values/insert-value-within-decimal-range.sql

File renamed without changes.

sql-queries-4/store-decimal-values/value-exceed-total-digit-integer.sql renamed to data-manipulation/store-decimal-values/value-exceed-total-digit-integer.sql

File renamed without changes.

sql-queries-4/store-decimal-values/values-exceeding-decimal-scale.sql renamed to data-manipulation/store-decimal-values/values-exceeding-decimal-scale.sql

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--using a Common Table Expression
2+
WITH RankedStudents AS (
3+
SELECT
4+
id, name, gpa,
5+
RANK() OVER (ORDER BY gpa DESC) AS r
6+
FROM Student
7+
WHERE gpa IS NOT NULL
8+
)
9+
SELECT id, name, gpa, r
10+
FROM RankedStudents
11+
WHERE r <= 3;
12+
13+
--using a subquery
14+
SELECT *
15+
FROM (
16+
SELECT
17+
id, name, gpa,
18+
RANK() OVER (ORDER BY gpa DESC) AS r
19+
FROM Student
20+
WHERE gpa IS NOT NULL
21+
) AS RankedStudents
22+
WHERE r <= 3;

sql-queries-7/Deleting-Rows-Using-LEFT-JOIN-SQL/LEFT-JOIN-basic usage.sql renamed to deleting/Deleting-Rows-Using-LEFT-JOIN-SQL/LEFT-JOIN-basic usage.sql

File renamed without changes.

0 commit comments

Comments
 (0)