Created
August 6, 2011 01:16
-
-
Save mohamedmansour/1128873 to your computer and use it in GitHub Desktop.
Which users are similar to me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
@UserBit_50 = | |
IFNULL( | |
convert(profilevalue_50, unsigned) | |
,0 | |
) | |
FROM | |
se_profilevalues | |
WHERE | |
profilevalue_user_id = 1; | |
SELECT | |
SUM( | |
( | |
convert( IFNULL(profilevalue_50, 0) , unsigned ) & | |
@UserBit_50) > 0 | |
) / ( | |
SELECT COUNT(*) FROM se_profilevalues | |
) AS 'Avg Intersection' | |
FROM | |
se_profilevalues | |
WHERE | |
profilevalue_user_id != 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment