Files
Jellystat/SQL Scripts/3. CREATE VIEWS/CREATE VIEW js_most_active_user.sql
Thegan Govender 582a39918e full change to statistics
1) Created components for statistic reporting.
2) Database changes and PROC/Function creations. Still need to make MOST VIEWED LIBRARIES/CLIENTS/ MOST ACTIVE USERS dynamically load with date range (Function Creation on DB side)
2023-03-19 22:01:40 +02:00

17 lines
428 B
SQL

-- View: public.js_most_active_user
-- DROP VIEW public.js_most_active_user;
CREATE OR REPLACE VIEW public.js_most_active_user
AS
SELECT count(*) AS "Plays",
jf_playback_activity."UserId",
jf_playback_activity."UserName"
FROM jf_playback_activity
GROUP BY jf_playback_activity."UserId", jf_playback_activity."UserName"
ORDER BY (count(*)) DESC;
ALTER TABLE public.js_most_active_user
OWNER TO postgres;