Entering query
来源:互联网 发布:python参考手册 第5版 编辑:程序博客网 时间:2024/05/21 03:28
This section describes the basic principles of entering commands, using several queries you can try out to familiarize yourself with howmysql works.
mysql> SELECT VERSION(), CURRENT_DATE;+------------+--------------+| VERSION() | CURRENT_DATE |+------------+--------------+| 5.6.21-log | 2014-10-14 |+------------+--------------+row in set (0.05 sec)mysql>
Here is another query. It demonstrates that you can usemysql as a simple calculator:
mysql> SELECT SIN(PI()/4), (3+2)*5;+--------------------+---------+| SIN(PI()/4) | (3+2)*5 |+--------------------+---------+| 0.7071067811865475 | 25 |+--------------------+---------+
The queries shown thus far have been relatively short, single-line statements. You can even entermultiple statements on a single line. Just end each one with a semicolon:
mysql> SELECT VERSION(); SELECT NOW();+------------+| VERSION() |+------------+| 5.6.21-log |+------------+row in set (0.30 sec)+---------------------+| NOW() |+---------------------+| 2014-10-16 14:27:13 |+---------------------+row in set (0.19 sec)mysql>
A command need not be given all on a single line, so lengthy commands that require several lines are not a problem.mysql determines where your statement ends by looking forthe terminating semicolon, not by looking for the end of the input line. (In other words,mysql accepts free-format input: it collects input lines but does not execute themuntil it sees the semicolon.)
Here is a simple multiple-line statement:
<span style="font-family:FangSong_GB2312;font-size:14px;">mysql> SELECT -> USER() -> , -> CURRENT_DATE;+----------------+--------------+| USER() | CURRENT_DATE |+----------------+--------------+| root@localhost | 2014-10-16 |+----------------+--------------+</span>If you decide you do not want to execute a command that you are in the process of entering, cancel it by typing
\c
:mysql> SELECT -> USER() -> \C ;;小写的才对ERROR: Usage: \C charset_name | charset charset_name -> \cmysql>
0 0
- Entering query
- Query
- query
- query
- Query
- QUERY
- query
- query
- QUERY
- Domino - Entering system commands correctly
- Entering Order Pad Options (from Requisitions)
- sudoer, run privileged program without entering password
- 227 Entering Passive Mode 的解决办法!
- Script which ssh login without entering password
- VMX学习-enabling and entering VMX operation
- Putty exits immediately after entering login command
- Entering Device Firmware Upgrade (DFU) mode
- [收藏]Entering the Linux Community(官方linux参考资源)
- php 类似百度搜索的分页
- 深入了解Spring
- Ubuntu问题集锦
- C语言中的static 详细分析
- 108. Convert Sorted Array to Binary Search Tree
- Entering query
- 使用Code::Blacks运行不了c++程序
- HTML5+JS游戏开发模块----canvas打字游戏升级版
- 对10个数进行排序
- Matlab2014a在Ubuntu16.04中的安装及遇到的问题
- Java知识碎片整理(1)——数组相关
- 分时系统与实时系统
- 【Search&String Algorithm Training】Xiper的奇妙历险(2)
- 编程相关的知识点细节