home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / sel000003.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  465 b   |  19 lines  |  [TEXT/ttxt]

  1. # sel000003
  2. #
  3. # Versions
  4. # --------
  5. #   3.22
  6. #   3.23
  7. #
  8. # Description
  9. # -----------
  10. # This test is just a simple select.
  11. # Testing count() function and GROUP BY clause.
  12. #
  13.  
  14. DROP TABLE IF EXISTS t1;
  15. CREATE TABLE t1 (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score));
  16. INSERT INTO t1 VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10);
  17. SELECT COUNT(*) as n, score FROM t1 GROUP BY score;
  18. drop table t1;
  19.