All pastes #821616 Raw Edit

Mine

public text v1 · immutable
·published 2007-12-18 06:36 UTC
rendered paste body
	$result = mysql_query("
	select yr
     , mth
     , sum(main_subtot)      as main_count
     , sum(pop_subtot)       as pop_count
  from (
       select year(add_date)        as yr
            , month(add_date)       as mth
            , count(*)              as main_subtot
            , NULL as pop_subtot
         from clogsyn_track_main
        where user_id = $uid
       group
           by year(add_date)
            , month(add_date)
       union all
       select year(add_date)
            , month(add_date)
            , NULL
            , count(*)
         from clogsyn_track_pop
        where user_id = $uid
       group
           by year(add_date)
            , month(add_date)
       ) as data
group
    by yr
     , mth
	");