Home > Database > Mysql Tutorial > 你可能不知道的MySQL_MySQL

你可能不知道的MySQL_MySQL

WBOY
Release: 2016-06-01 14:02:36
Original
792 people have browsed it

  mysql> desc tbl_name;

  +-------+--------------+------+-----+---------+-------+

  | Field | Type         | Null | Key | Default | Extra |

  +-------+--------------+------+-----+---------+-------+

  | uid   | int(11)      | NO   |     | NULL    |       |

  | sid   | mediumint(9) | NO   |     | NULL    |       |

  | times | mediumint(9) | NO   |     | NULL    |       |

  +-------+--------------+------+-----+---------+-------+

  3 rows in set (0.00 sec)

  存储引擎是MyISAM,里面有10,000条数据。

  一、“\G”的作用

  mysql> select * from tbl_name limit 1;

  +--------+--------+-------+

  | uid    | sid    | times |

  +--------+--------+-------+

  | 104460 | 291250 |    29 |

  +--------+--------+-------+

  1 row in set (0.00 sec)

  mysql> select * from tbl_name limit 1\G;

  *************************** 1. row ***************************

  uid: 104460

  sid: 291250

  times: 29

  1 row in set (0.00 sec)有时候,操作返回的列数非常多,屏幕不能一行显示完,显示折行,试试”\G”,把列数据逐行显示(”\G”挽救了我,以前看explain语句横向显示不全折行看起来巨费劲,还要把数据和列对应起来)。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template