Hi..
I have the following query.. missing something based on 'net searches. but
how do i create a "group" to allow me to get a single "row"/count based on
the 'd1_status.dept_id'

i can't figure out exactly where in the query to have the "count(*) xxx
group by abc"... the few different approaches i've tried have led to errs...

any pointers/comments will be appreciated.

thanks


mysql> select *
    ->  from course1
    ->  join d1
    ->  on course1.dID=d1.id
    ->  join c1
    ->  on c1.id=d1.cID
    ->  join d1_status
    ->  on d1_status.dept_id=d1.id
    ->  where course1.id=1
    ->  and c1.id=1;
+----------+------+-----+----+-------+-----+----+-------+---------+----+----
----+---------+--------+----+
| cname    | dID  | fID | id | dname | cID | id | cname | stateID | id |
userID | dept_id | status | id |
+----------+------+-----+----+-------+-----+----+-------+---------+----+----
----+---------+--------+----+
| math-101 |    1 |   1 |  1 | math  |   1 |  1 | usc   |       1 |  1 | 1
|       1 |      1 |  1 |
| math-101 |    1 |   1 |  1 | math  |   1 |  1 | usc   |       1 |  1 | 2
|       1 |      1 |  4 |
+----------+------+-----+----+-------+-----+----+-------+---------+----+----
----+---------+--------+----+
2 rows in set (0.00 sec)



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to