Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: how to design this sql query? Thanks


Message #1 by "dbdbdb" <beaker@h...> on Sun, 15 Sep 2002 23:08:00
select time,name,COUNT(name) from t1
GROUP BY name,time

Cheers.
Brian

-----Original Message-----
From: dbdbdb [mailto:beaker@h...]
Sent: Sunday, September 15, 2002 7:08 PM
To: sql language
Subject: [sql_language] how to design this sql query? Thanks


I have t1:
id  time  name
--  ----  ----
201 7     bio
202 7     cit
203 7     cit
226 8     bio
227 8     cit

how to realise t2£º
time  name  seq
----  ----  ---
7     bio   1
7     cit   2
8     bio   1
8     cit   1

I tried COUNT(name) and GROUP BY name,It showed:
name  seq
----  ---
bio   2
cit   3
But I have no idea with the "time"....



  Return to Index