Właśnie otrzymałem tę odpowiedź z poprzedniego pytania i działa to naprawdę dobrze!Nielegalna mieszanka błędu sortowania w MySql
SELECT username, (SUM(rating)/COUNT(*)) as TheAverage, Count(*) as TheCount
FROM ratings WHERE month='Aug' GROUP BY username HAVING TheCount > 4
ORDER BY TheAverage DESC, TheCount DESC
Ale kiedy trzymać ten dodatkowy kawałek w nim daje ten błąd:
Documentation #1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='
SELECT username, (SUM(rating)/COUNT(*)) as TheAverage, Count(*) as TheCount FROM
ratings WHERE month='Aug'
**AND username IN (SELECT username FROM users WHERE gender =1)**
GROUP BY username HAVING TheCount > 4 ORDER BY TheAverage DESC, TheCount DESC
tabeli jest:
id, username, rating, month
przy okazji, czy Twoja kolumna users.gender ma typ int? – stereoscott
Próbowałem tego: SELECT ocena .username, (SUMA (oceny.rating)/COUNT (*)) jako TheAverage, Count (*) jako TheCount FROM ocen, użytkowników WHERE ratings.month = "Aug" i ratings.username = users.username AND users.gender = 1 GROUP BY ratingss.username HAVING TheCount> 4 ORDER BY TheAverage DESC, TheCount DESC Masz ten sam błąd co poprzednio? Tak, płeć to int. – Oliver