MySQL can have quite messy output when running queries from the mysql
cli. You can terminate a statement with \G
instead of ;
to format as a list instead of table.
SELECT * FROM users\G
Alternatively, you can set the pager to less
which retains the table format and can be scrolled with arrowkeys.
pager less -SFX SELECT * FROM users; nopager; -- to turn off
SELECT a.* FROM map_ads_categories m JOIN ads a ON (m.ad_id = a.id) WHERE m.category_id = 28;
SELECT * FROM map_ads_categories m JOIN ads a ON (m.ad_id = a.id) JOIN categories c ON (m.category_id = c.id) WHERE c.id = 28;