I’m still looking for new entries. I get quite a few
suggestions, but not all of them make it into quiz questions. Do
send in your suggestions!
In mysql>, you already know that hitting return on this:
SELECT 1+1, 2+2;
returns this:
+-----+-----+
| 1+1 | 2+2 |
+-----+-----+
| 2 | 4 |
+-----+-----+
What happens if you instead hit return after the following line?
SELECT 1+1, 2+2\\g
or this one?
SELECT 1+1, 2+2\\G
Show hint
Hint: Fire up an instance of mysql> and read
the messages at the start of the session. (and while there, also
type in the examples. They won’t do any damage).
Show answer
Answer: \g works just the same as ; .
\G does the same thing, too, but the output is displayed
“vertically”, i.e. with one column name/field value per line.
This is …
[Read more]