Reposted some simple command comparison of Oracle and MySQL [June 25, 2004 22:35]

zhaozj2021-02-16  60

Some simple commands of Oracle and MySQL comparison reference

Http://202.101.18.235/club/bbs/showssnce.asp?id=22161&page=2

Project | Oracle | MySQL

=========================================

Comparative version | 7.3.4.0.0 | 3.22.34

-------------------------------------------------- ------------------

Console Tools | SVRMGR.EXE | MySQLADMIN.EXE | SVRMGR23.EXE |

-------------------------------------------------- ------------------

Database Launcher | 0start73.exe Screen | MySQLD-ShaReware.exe

-------------------------------------------------- ------------------

Close the database command | Ostop73.exe | mysqladmin.exe -u root shutdown

-------------------------------------------------- ------------------

With user start-up mode |

C: /orawin95/bin/sqlplus.exe system / manager @ TNS |

C: /mysql/bin/mysql.exe test c: /mysql/bin/mysql.exe -u root test

-------------------------------------------------- ------------------

Default user (library) | SYS | MySQL

| System | Test

| Scott

-------------------------------------------------- ------------------

All tables | SQL> SELECT * from Tab; | MySQL> show tables;

| SQL> SELECT * from cat; | c: / mysql / bin> mysqlshow library name

-------------------------------------------------- -----------------

Current User (Library) | SQL> Show User | MySQL> Connect

-------------------------------------------------- ------------------

Display Table Structure | SQL> DESC Table Name | MySQL> DESC Table Download;

| SQL> Describe table name | mysql> Describe table name;

| | Mysql> show columns from table name; | | c: / mysql / bin> mysqlshow library name table name

-------------------------------------------------- ------------------

Date function | SQL> SELECT SYSDATE.

| | MySQL> Select now ();

| | MySQL> Select sysdate ();

| | MySQL> Select Curdate ();

| | MySQL> Select Current_Date;

| | MySQL> Select Curtime ();

| | MySQL> Select Current_time;

-------------------------------------------------- ---------------------

Date format | 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');

-------------------------------------------------- ---------------------

Period function (add one month)

| SQL> SELECT | TO_CHAR (add_months (to_date ('20000101'), 1), 'YYYY-MM-DD') from | Dual; Results: 2000-02-01

| | MySQL> SELECT DATE_ADD ('2000-01-01', Interval 1 Month);

| | | Result: 2000-02-01

-------------------------------------------------- -----------------

String intercept | Substr ('Abcdefg', 1, 5) | MID ('Abcdefg', 2, 3);

Substrb ('Abcdefg', 1, 5) | Substring ('Abcdefg', 2, 3);

| | Substring ('Abcdefg' from 2);

-------------------------------------------------- ------------------ External scripting command | SQL> @ a.sql | 1: mysql> Source A.sql

| | 2: C: / mysql / bin> mysql

| | 3: C: / mysql / bin> MySQL library name

-------------------------------------------------- -----------------

Import, export | exp.exe | mysqldump.exe

| EXP73.EXE | MySQLIMPORT.EXE

| imp.exe |

| Imp73.exe |

-------------------------------------------------- ----------------

Restriction record number | SQL> SELECT * FROM table name WHERE ROWNUM <5;

| | MySQL> SELECT * FROM table name LIMIT 5;

-------------------------------------------------- -----------------

Outer connection | Using ( ) | Using Left Join

转载请注明原文地址:https://www.9cbs.com/read-17193.html

New Post(0)