mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 4.1.7-nt  |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE TABLE test (col1 INT, col2 INT, col3 INT);
Query OK, 0 rows affected (0.08 sec)

mysql> INSERT INTO test VALUES (1, 1, 1), (1, 2, 3);
Query OK, 2 rows affected (0.02 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM test;
+------+------+------+
| col1 | col2 | col3 |
+------+------+------+
|    1 |    1 |    1 |
|    1 |    2 |    3 |
+------+------+------+
2 rows in set (0.00 sec)

mysql> SELECT col1, MAX(col2), col3 FROM test GROUP BY col1;
+------+-----------+------+
| col1 | MAX(col2) | col3 |
+------+-----------+------+
|    1 |         2 |    1 |
+------+-----------+------+
1 row in set (0.00 sec)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to