title image


Smiley Problem beim Addieren
SELECT cbook_users.userid, cbook_users.name, cbook_users.nickname, cbook_users.age, cbook_users.wohnort, count( DISTINCT cbook_kirmes.kirmesid, cbook_kirmes.userid ) AS zaehler

FROM cbook_users, cbook_kirmes

WHERE cbook_users.online = '1'

AND cbook_users.userid = cbook_kirmes.userid

AND jahr = '2006'

GROUP BY cbook_users.userid

UNION

SELECT cbook_users.userid, cbook_users.name, cbook_users.nickname, cbook_users.age, cbook_users.wohnort, count( DISTINCT cbook_ride.rideid, cbook_ride.userid ) AS zaehler

FROM cbook_users, cbook_ride

WHERE cbook_users.online = '1'

AND cbook_users.userid = cbook_ride.userid

AND jahr = '2006'

GROUP BY cbook_users.userid

ORDER BY zaehler DESC





Hallöchen an alle!!!



Wie sage ich der DB das sie die zwei "zaehler" (der eine aus cbook_ride und der andere aus cbook_kirmes) addieren soll?





Vielen Dank im Vorraus

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: