¸ømysqlÌí¼ÓÒ»¸ö¹ÜÀíÔ±µÄSQLÓï¾ä
insert into mysql.user
SELECT '%', 'admin', PASSWORD('admin'), Select_priv, Insert_priv, Update_priv,
Delete_priv, Create_priv, Drop_priv, Reload_priv,
Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv,
Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv,
Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv,
Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv,
Create_user_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject,
max_questions, max_updates, max_connections, MAX_USER_CONNECTIONS
from mysql.user WHERE user='root';
×î½ü°²×°ÁËÒ»¸ö¶«Î÷, ×Ô´øMYSQL, ²»ÖªµÀROOTÃÜÂë, ²¢ÇÒÏÞÖÆÖ»ÄÜÔÚ±¾µØµÇ¼. ¼ÓÒ»¸öÓû§½øÈ¥ ¸ü·½±ã.
Ïà¹ØÎĵµ£º
SQL²Ù×÷È«¼¯
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1 ......
SQLÓï·¨ÊÖ²á
Select
ÓÃ;£º
´ÓÖ¸¶¨±íÖÐÈ¡³öÖ¸¶¨µÄÁеÄÊý¾Ý
Óï·¨£º
SELECT column_name(s) from table_name
½âÊÍ£º
´ÓÊý¾Ý¿âÖÐÑ¡È¡×ÊÁÏÁУ¬²¢ÔÊÐí´ÓÒ»»ò¶à¸ö×ÊÁϱíÖУ¬Ñ¡È¡Ò»»ò¶à¸ö×ÊÁÏÁлò×ÊÁÏÐС£SELECT ³ÂÊöʽµÄÍêÕûÓï·¨Ï൱¸´ÔÓ£¬µ«Ö÷Òª×Ó¾ä¿ÉժҪΪ£º
SELECT select_ ......
NULL£¬±íʾ²»Ã÷È·¡¢Î´ÖªµÄÁÐÖµ
²âÊÔ±í£ºtestnull(id varchar(32))
Êý¾Ý¿â£ºSybase ASA11.0
ÐÐÊý¾Ý(''), (NULL)
Êý¾Ý¿âÑ¡ÏîansinullΪtrue(Ò²ÊÇASAÊý¾Ý¿âµÄĬÈÏÑ¡Ïî)ʱ£¬
select * from testnull where id = null
select * from testnull where id != null
½á¹û¾ùΪ¿Õ
select * from testnull where id is null
½á¹ ......
Êý¾Ý¶¨ÒåÓïÑÔ£¨DDL£©£º
1£©´´½¨Êý¾Ý¿â£¨create£©£ºcreate database database-name;
eg. create database test;
2£©É¾³ýÊý¾Ý¿â£ºdrop database dbname;
& ......
SQLÖÐÎÄÎÊÅÅÐò
Ê×ÏÈ°ÑÕâЩÐÅÏ¢ÔÚeditplusÖУ¬×ª»»ÎªÒ»ÁУ¬¿½±´µ½excelÖУ¬¿½±´ºó¼Ç×ÅÔÚµÚÒ»ÐÐÇ°²åÈëÒ»ÐУ¬×÷ΪÁбêÍ·£¬ÀýÈçΪname£¬È»ºóÔÚsqlÖбíÖУ¬µ¼ÈëÊý¾Ý£¬Éú³ÉÒ»¸öÐÂ±í£¬ÀýÈçfenlei£¬´ò¿ªsqlÓï¾äÐУ¬Ö´ÐУº
SELECT *
from Fenlei
ORDER BY name COLLATE Chinese_PRC_CS_AS_KS_WS
......