From e290c557994ea3531ef87bf2f40ad119af6aa970 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Mon, 21 Dec 2015 08:09:00 +0100 Subject: [PATCH] add constraint on friendship for wideskill view --- sql/sql.d/075-users-network.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql.d/075-users-network.sql b/sql/sql.d/075-users-network.sql index a371ec5..a4a9958 100644 --- a/sql/sql.d/075-users-network.sql +++ b/sql/sql.d/075-users-network.sql @@ -41,7 +41,8 @@ DROP VIEW #PFX#usersnet_wideskill; CREATE VIEW #PFX#usersnet_wideskill AS SELECT un.owner, ur.target, SUM(ur.skill * un.trust) / SUM(un.trust) as skill, count(*) as count FROM #PFX#usersnet AS un, #PFX#usersnet AS ur - WHERE un.target = ur.owner AND un.friend >= 4 -- 'un' is, at least, our friend + WHERE un.target = ur.owner AND un.friend >= 4 -- 'un' is, at least, our friend + AND ur.friend > 2 GROUP BY un.owner, ur.target; DROP VIEW #PFX#usersnet_narrowskill; -- 2.17.1