Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL 4.1.0 Chinese reference Manual-6.6 basic MySQL user practical commands (to be transferred)

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MySQL 4.1.0 Chinese reference manual-- 6.6 basic MySQL user utility commands [@ more@] code {color:purple} tt {color:green} samp {color:navy} pre {color:maroon} MYSQL 4.1.0 Chinese reference manual > words "content=" MySQL,4.1.0,Shuixin13,MySQL 4.1.0, Chinese, Chinese reference manual Dog (Xinfan) "> CSS rel=STYLESHEET > MySQL Reference Manual for version 4.1.0-alpha.6.6 basic MySQL user utility command 6.6.1 USE syntax

USE db_name

The USE db_name statement tells MySQL to use the db_name database as the default database for future queries. The database remains the current database until the session ends or another USE statement is issued:

Mysql > USE db1; mysql > select COUNT (*) FROM mytable; # Select mysql > USE DB2; mysql > SELECT COUNT (*) FROM mytable; # from db1.mytable

Depending on the USE statement to set a particular database as the current database does not prevent you from accessing tables in another data. The following example accesses the author table in the db1 database and the editor table in the db2 database:

Mysql > USE db1; mysql > SELECT author_name,editor_name FROM author,db2.editor-> WHERE author.editor_id = db2.editor.editor_id

The USE statement provides compatibility with Sybase.

6.6.2 DESCRIBE syntax (get column information)

{DESCRIBE | DESC} tbl_name [col_name | wild]

DESCRIBE is the abbreviation of SHOW COLUMNS FROM. See Section 4.5.6.1 to retrieve information about databases, tables, columns, and indexes.

DESCRIBE provides column information about a table. Col_name can be a column name or a string containing the SQL wildcard characters "%" and "_". There is no need to enclose the string in quotation marks.

If the column type is different from the column you expect to build based on a CREATE TABLE statement, note that MySQL sometimes changes the column type. Check out the implicit column definition changes in section 6.5.3.1.

This statement is provided to ORACLE-compatible.

The SHOW statement provides similar information. Check the syntax of section 4.5.6 SHOW.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report