phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cheyenne Forbes <cheyenne.osanu.for...@gmail.com>
Subject Using COUNT() with columns that don't use COUNT() when the table is join fails
Date Mon, 19 Sep 2016 04:03:10 GMT
 this query fails:

SELECT COUNT(fr.friend_1), u.first_name
>
>         FROM users AS u
>
>         LEFT JOIN friends AS fr ON u.id = fr.friend_2
>
>
with:

SQLException: ERROR 1018 (42Y27): Aggregate may not contain columns not in
> GROUP BY. U.FIRST_NAME
>

TABLES:

users table with these columns ( id, first_name, last_name )


friends table with these columns ( friend_1, friend_2 )

Mime
View raw message