Yingyos <[EMAIL PROTECTED]> wrote:
>
> I type this command line.
>
> mysql -uuser -N -e"select date_format('2004-02-29','%X')" > sample2.txt
>
> When i open in text editor,it show that '2004' only.
>
> But i want format display on text file.
>
> mysql> select date_format('2004-02-29','%X');
> +--------------------------------+
> | date_format('2004-02-29','%X') |
> +--------------------------------+
> | 2004 |
> +--------------------------------+
> 1 row in set (0.00 sec)
>
> How 's to do?
>
Use --tee/--no-tee options or tee/notee commands of mysql client:
http://dev.mysql.com/doc/mysql/en/mysql.html
http://dev.mysql.com/doc/mysql/en/mysql_Commands.html
For example:
mysql> tee file.txt;
Logging to file 'file.txt'
mysql> SELECT DATE_FORMAT('2004-02-29','%X');
+--------------------------------+
| DATE_FORMAT('2004-02-29','%X') |
+--------------------------------+
| 2004 |
+--------------------------------+
1 row in set (0.01 sec)
mysql> notee;
Outfile disabled.
mysql>
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Victoria Reznichenko
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]