Changes between Version 9 and Version 10 of Напредни извештаи од базата (SQL и складирани процедури)
- Timestamp:
- 01/11/25 16:12:50 (4 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Напредни извештаи од базата (SQL и складирани процедури)
v9 v10 3 3 === Извештај за членови со најмногу позајмувања === 4 4 {{{#!sql 5 SELECT users.FirstName, users.LastName, COUNT(loan.LoanID) AS loan_count 5 SELECT 6 users.FirstName, 7 users.LastName, 8 EXTRACT(MONTH FROM loan.LoanDate) AS month, 9 COUNT(loan.LoanID) AS loan_count 6 10 FROM users 7 11 INNER JOIN loan ON users.UserID = loan.MemberID 8 GROUP BY users.UserID, users.FirstName, users.LastName 12 WHERE EXTRACT(MONTH FROM loan.LoanDate) = 4 -- Change this number for different months (1-12) 13 GROUP BY 14 users.UserID, 15 users.FirstName, 16 users.LastName, 17 EXTRACT(MONTH FROM loan.LoanDate) 9 18 ORDER BY loan_count DESC 10 19 LIMIT 5;