mysql命令⾏分隔符
ded up just taking the tab delimited output and copy pasting it to a spreadsheet and then exporting that to csv. Also realized that I could have used the concat or concat_ws function to do the job and will do that next time.
SELECT CONCAT_WS(',', field1, field2, field3) FROM table;
You may want to use '--silent' option to remove tabular output
, -s
Silent mode. Produce less output. This option can be given multiple times to produce less and less
output.
This option results in nontabular output format and escaping of special characters. Escaping may be
disabled by using raw mode; see the description for the option.
, -r
For tabular output, the “boxing” around columns enables one column value to be distinguished from
another. For nontabular output (such as is produced in batch mode or when the or option is given),
special characters are escaped in the output so they can be identified easily. Newline, tab, NUL, and
backslash are written as \n, \t, \0, and \\. The option disables this character escaping.
The following example demonstrates tabular versus nontabular output and the use of raw mode to
disable escaping:
%
mysql
mysql> SELECT CHAR(92);
+----------+
| CHAR(92) |
mysql下载add produce+----------+
| \ |
+----------+
%
mysql -s
mysql> SELECT CHAR(92);
CHAR(92)
\\
%
mysql -s -r
mysql> SELECT CHAR(92);
CHAR(92)
\
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论