phpbar.de logo

Mailinglisten-Archive

[php] OT: mysql subselect in selection SOLVED

[php] OT: mysql subselect in selection SOLVED

Michael Borchers list at tridemail.de
Fre Sep 22 10:58:01 CEST 2006


> SELECT users.users_id, users.users_level
>
> ( SELECT max ( users_groups.level )
>
> FROM users_groups, users2users_groups
>
> WHERE users_groups.users_id = users.users_id
>
> AND users_groups.users_groups_id = users_groups.users_groups_id ) AS
> group_level
>
> FROM users
>
>
>
> kann mysql 4.1 das "noch" nicht?!
>

SELECT users.users_id, users.users_level, 
MAX(users_groups.users_groups_level)
FROM users
LEFT OUTER JOIN users2users_groups ON users2users_groups.users_id = 
users.users_id
LEFT OUTER JOIN users_groups ON users2users_groups.users_id  = 
users.users_id
AND users2users_groups.users_groups_id     = users_groups.users_groups_id
GROUP BY users.users_id 


php::bar PHP Wiki   -   Listenarchive