Working with MySQL
matthewd@carbonara:~$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2792799
Server version: 5.0.38-log Gentoo Linux mysql-5.0.38
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use b3
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SELECT count(*) FROM interaction WHERE idRecord=3720322;
+----------+
| count(*) |
+----------+
| 30 |
+----------+
1 row in set (0.00 sec)
mysql> SELECT count(*) FROM interaction WHERE idRecord=3720322 ORDER BY `create` DESC, `id` DESC;
+----------+
| count(*) |
+----------+
| 30 |
+----------+
1 row in set (0.00 sec)
mysql> SELECT * FROM interaction WHERE idRecord=3720322;
+---------+---------------------+----------+--------+-----------+
| id | create | idRecord | idUser | idOutcome |
+---------+---------------------+----------+--------+-----------+
... snip 30 rows ...
+---------+---------------------+----------+--------+-----------+
30 rows in set (0.01 sec)
mysql> SELECT * FROM interaction WHERE idRecord=3720322 ORDER BY `create` DESC, `id` DESC;
Empty set (0.00 sec)
mysql>
Isn’t MySQL grand?