| 订阅 | 在线投稿
分享
 
 
 

Oracle和mysql 的一些简单命令对比参照

来源:互联网  宽屏版  评论
2008-05-31 20:48:11

本文为【Oracle和mysql 的一些简单命令对比参照】的汉字拼音对照版显示拼音

kongzhitaigongju

SVRMGR.EXE

SVRMGR23.EXE

mysqladmin.exe

shujukuqidongchengxu

0start73.exe screen

mysqld-shareware.exe

guanbishujukumingling

ostop73.exe

mysqladmin.exe -u root shutdown

kehuchengxu

SQL*Plus

mysql

qidongmingling

c:\orawin95\bin\sqlplus.exe

c:\mysql\bin\mysql.exe

daiyonghuqidongfangshi

zhijieliankufangshi

c:\orawin95\bin\sqlplus.exe system/manager@TNS

c:\mysql\bin\mysql.exe test

c:\mysql\bin\mysql.exe -u root test

anzhuanghouxitongmorenyonghuku

sys

system

scott

mysql

test

xianshisuoyouyonghuku

SQL >select * from all_users;

C:\mysql\bin>mysqlshow

C:\mysql\bin>mysqlshow --status

mysql> show databases;

退tuichumingling

SQL> exit

SQL> quit

mysql> exit

mysql> quit

gaibianlianjieyonghuku

SQL> conn yonghuming/mima@zhujizifuchuan

mysql> use kuming

chaxundangqiansuoyoudebiao

SQL> select * from tab;

SQL> select * from cat;

mysql> show tables;

c:\mysql\bin>mysqlshow kuming

xianshidangqianlianjieyonghuku

SQL> show user

mysql> connect

chakanbangzhu

SQL> ?

mysql> help

xianshibiaojiegou

SQL> desc biaoming

SQL> describe biaoming

mysql> desc biaoming;

mysql> describe biaoming;

mysql> show columns from biaoming;

c:\mysql\bin>mysqlshow kuming biaoming

riqihanshu

SQL> select sysdate from dual;

mysql> select now();

mysql> select sysdate();

mysql> select curdate();

mysql> select current_date;

mysql> select curtime();

mysql> select current_time;

riqigeshihua

SQL> select to_char(sysdate,'yyyy-mm-dd') from dual;

SQL> select to_char(sysdate,'hh24-mi-ss') from dual;

mysql> select date_format(now(),'%Y-%m-%d');

mysql> select time_format(now(),'%H-%i-%S');

riqihanshu

zengjiayigeyue

SQL> select to_char(add_months(to_date('20000101','yyyymmdd'),1),'yyyy-mm-dd') from dual;

jieguo2000-02-01

SQL> select to_char(add_months(to_date('20000101','yyyymmdd'),5),'yyyy-mm-dd') from dual;

jieguo2000-06-01

mysql> select date_add('2000-01-01',interval 1 month);

jieguo2000-02-01

mysql> select date_add('2000-01-01',interval 5 month);

jieguo2000-06-01

bieming

SQL> select 1 a from dual;

mysql> select 1 as a;

zifuchuanjiequhanshu

SQL> select substr('abcdefg',1,5) from dual;

SQL> select substrb('abcdefg',1,5) from dual;

jieguoabcde

mysql> select substring('abcdefg',2,3);

jieguobcd

mysql> select mid('abcdefg',2,3);

jieguobcd

mysql> select substring('abcdefg',2);

jieguobcdefg

mysql> select substring('abcdefg' from 2);

jieguobcdefg

lingyouSUBSTRING_INDEX(str,delim,count)hanshu

fanhuicongzifuchuanstrdedicountgechuxiandefengefudelimzhihoudezichuan

jiarucountshizhengshufanhuizuihoudefengefudaozuobian(congzuobianshu) desuoyouzifu

jiarucountshifushufanhuizuihoudefengefudaoyoubiandesuoyouzifu(congyoubianshu)

zhixingwaibujiaobenmingling

SQL >@a.sql

1mysql> source a.sql

2c:\mysql\bin>mysql <a.sql

3c:\mysql\bin>mysql kuming <a.sql

daorudaochugongju

eXP.exe

exp73.exe

imp.exe

imp73.exe

mysqldump.exe

mysqlimport.exe

gaibiaoming

SQL> rename a to b;

mysql> alter table a rename b;

zhixingmingling

;<huiche>

/

r

run

;<huiche>

go

ego

distinctyongfa

SQL> select distinct lie1 from biao1;

SQL> select distinct lie1,lie2 from biao1;

mysql> select distinct lie1 from biao1;

mysql> select distinct lie1,lie2 from biao1;

zhushi

--

/*yu*/

#

--

/*yu*/

dangzuojisuanqi

SQL> select 1+1 from dual;

mysql> select 1+1;

xianzhifanhuijilutiaoshu

SQL> select * from biaoming where rownum<5;

mysql> select * from biaoming limit 5;

xinjianyonghuku

SQL> create user yonghuming identified by mima;

mysql> create database kuming;

shanyonghuku

SQL> drop user yonghuming;

mysql> drop database kuming;

wailianjie

使shiyong(+)

使shiyongleft join

chaxunsuoyin

SQL> select index_name,table_name from user_indexes;

mysql> show index from biaoming [FROM kuming];

tongpeifu

%

%he_

SQLyufa

SELECT selection_list xuanzenaxielie

FROM table_list conghechuxuanzexing

WHERE primary_constraint xingbixumanzushenmetiaojian

GROUP BY grouping_columns zenyangduijieguofenzu

HAVING secondary_constraint xingbixumanzudediertiaojian

ORDER BY sorting_columns zenyangduijieguopaixu

SELECT selection_list xuanzenaxielie

FROM table_list conghechuxuanzexing

WHERE primary_constraint xingbixumanzushenmetiaojian

GROUP BY grouping_columns zenyangduijieguofenzu

HAVING secondary_constraint xingbixumanzudediertiaojian

ORDER BY sorting_columns zenyangduijieguopaixu

LIMIT count jieguoxianding

Trackback: http://tb.blog.csdn.net/TrackBack.ASPx?PostId=1471658

原文
 
控制台工具 SVRMGR.EXE SVRMGR23.EXE mysqladmin.exe 数据库启动程序 0start73.exe screen mysqld-shareware.exe 关闭数据库命令 ostop73.exe mysqladmin.exe -u root shutdown 客户程序 SQL*Plus mysql 启动命令 c:\orawin95\bin\sqlplus.exe c:\mysql\bin\mysql.exe 带用户启动方式 (直接连库方式) c:\orawin95\bin\sqlplus.exe system/manager@TNS c:\mysql\bin\mysql.exe test c:\mysql\bin\mysql.exe -u root test 安装后系统默认用户(库) sys system scott mysql test 显示所有用户(库) SQL >select * from all_users; C:\mysql\bin>mysqlshow C:\mysql\bin>mysqlshow --status mysql> show databases; 退出命令 SQL> exit SQL> quit mysql> exit mysql> quit 改变连接用户(库) SQL> conn 用户名/密码@主机字符串 mysql> use 库名 查询当前所有的表 SQL> select * from tab; SQL> select * from cat; mysql> show tables; c:\mysql\bin>mysqlshow 库名 显示当前连接用户(库) SQL> show user mysql> connect 查看帮助 SQL> ? mysql> help 显示表结构 SQL> desc 表名 SQL> describe 表名 mysql> desc 表名; mysql> describe 表名; mysql> show columns from 表名; c:\mysql\bin>mysqlshow 库名 表名 日期函数 SQL> select sysdate from dual; mysql> select now(); mysql> select sysdate(); mysql> select curdate(); mysql> select current_date; mysql> select curtime(); mysql> select current_time; 日期格式化 SQL> select to_char(sysdate,'yyyy-mm-dd') from dual; SQL> select to_char(sysdate,'hh24-mi-ss') from dual; mysql> select date_format(now(),'%Y-%m-%d'); mysql> select time_format(now(),'%H-%i-%S'); 日期函数 (增加一个月) SQL> select to_char(add_months(to_date('20000101','yyyymmdd'),1),'yyyy-mm-dd') from dual; 结果:2000-02-01 SQL> select to_char(add_months(to_date('20000101','yyyymmdd'),5),'yyyy-mm-dd') from dual; 结果:2000-06-01 mysql> select date_add('2000-01-01',interval 1 month); 结果:2000-02-01 mysql> select date_add('2000-01-01',interval 5 month); 结果:2000-06-01 别名 SQL> select 1 a from dual; mysql> select 1 as a; 字符串截取函数 SQL> select substr('abcdefg',1,5) from dual; SQL> select substrb('abcdefg',1,5) from dual; 结果:abcde mysql> select substring('abcdefg',2,3); 结果:bcd mysql> select mid('abcdefg',2,3); 结果:bcd mysql> select substring('abcdefg',2); 结果:bcdefg mysql> select substring('abcdefg' from 2); 结果:bcdefg 另有SUBSTRING_INDEX(str,delim,count)函数 返回从字符串str的第count个出现的分隔符delim之后的子串。 假如count是正数,返回最后的分隔符到左边(从左边数) 的所有字符。 假如count是负数,返回最后的分隔符到右边的所有字符(从右边数)。 执行外部脚本命令 SQL >@a.sql 1:mysql> source a.sql 2:c:\mysql\bin>mysql <a.sql 3:c:\mysql\bin>mysql 库名 <a.sql 导入、导出工具 eXP.exe exp73.exe imp.exe imp73.exe mysqldump.exe mysqlimport.exe 改表名 SQL> rename a to b; mysql> alter table a rename b; 执行命令 ;<回车> / r run ;<回车> go ego distinct用法 SQL> select distinct 列1 from 表1; SQL> select distinct 列1,列2 from 表1; mysql> select distinct 列1 from 表1; mysql> select distinct 列1,列2 from 表1; 注释 -- /*与*/ # -- /*与*/ 当作计算器 SQL> select 1+1 from dual; mysql> select 1+1; 限制返回记录条数 SQL> select * from 表名 where rownum<5; mysql> select * from 表名 limit 5; 新建用户(库) SQL> create user 用户名 identified by 密码; mysql> create database 库名; 删用户(库) SQL> drop user 用户名; mysql> drop database 库名; 外连接 使用(+) 使用left join 查询索引 SQL> select index_name,table_name from user_indexes; mysql> show index from 表名 [FROM 库名]; 通配符 “%” “%”和“_” SQL语法 SELECT selection_list 选择哪些列 FROM table_list 从何处选择行 WHERE primary_constraint 行必须满足什么条件 GROUP BY grouping_columns 怎样对结果分组 HAVING secondary_constraint 行必须满足的第二条件 ORDER BY sorting_columns 怎样对结果排序 SELECT selection_list 选择哪些列 FROM table_list 从何处选择行 WHERE primary_constraint 行必须满足什么条件 GROUP BY grouping_columns 怎样对结果分组 HAVING secondary_constraint 行必须满足的第二条件 ORDER BY sorting_columns 怎样对结果排序 LIMIT count 结果限定 Trackback: http://tb.blog.csdn.net/TrackBack.ASPx?PostId=1471658
󰈣󰈤
 
 
 
>>返回首页<<
 
 热帖排行
 
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
©2005- 王朝网络 版权所有