[thelist] SQL Select -- Part II

Beam sbeam at syxyz.net
Mon Feb 17 10:35:01 CST 2003


> I have a MySQL database. In this database is a table containing
> scheduling information. One of the fields contains a start time for each
> record, and one of the fields contains an end time for each record. Each
> record is unconnected to any other record, so a lot of the start and end
> times are the same. I want to return a list of all of the different
> start and end times with no duplication. Can any fine fellow[ette]
> assist me in this task?

SELECT start_time, COUNT(id) FROM table GROUP BY start_time
or
SELECT DISTINCT start_time, end_time...
not fast but does it work?



More information about the thelist mailing list