Home > Database > Mysql Tutorial > body text

mysql-sample sql_MySQL

WBOY
Release: 2016-06-01 13:52:08
Original
1613 people have browsed it

1) show databases;

2) use db; 进入到数据库db

3) select database(); --显示当前数据库

4) select "consstr" as colname, t.* from tableName t;

5) select a.id,a.valueA, case (b.valueB is NULL) when 1 then 'z' else b.valueB end from tableA as a left join tableB as b on(id);

6)导入.sql脚本:

  在命令行下:mysql -h *** -u *** -p

      进入到mysql,在mysql>命令行下: source  **.sql


7)在mysql中可以让查询结果的每行竖排列,只需要用/G代替查询语句末尾的分号即可。如:

  select * from test limit 10 /G

8)show tables like '%name%';

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!