Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[SQL]´æ´¢¹ý³ÌµÄʹÓÃ

1.ÔÚmssql´´½¨´æ´¢¹ý³Ì,ÔÚdb->´æ´¢¹ý³Ì->н¨´æ´¢¹ý³Ì(ÓÒ¼ü)
CREATE PROCEDURE user_logon_check @username varchar(45),@userpsw varchar(45)
 AS
select * from users where UserName = @username and PasswordCode = @userpsw
return 10
GO
2.ÔÚmysql´´½¨´æ´¢¹ý³Ì,ʹÓÃMysql Query Browser,ÔÚdb->±íÃû->Create New Procedure/Function(ÓÒ¼ü)
DELIMITER \\
DROP PROCEDURE IF EXISTS `test`.`user_logon_check`\\
CREATE PROCEDURE `user_logon_check`(in username varchar(45),IN userpsw varchar(45))
BEGIN
  SELECT * from test where name = username and psw = userpsw;
END\\
DELIMITER ;
×¢Ò⽫ $$ -> \\


Ïà¹ØÎĵµ£º

SQLÃæÊÔÌâ


Insert Into Êý¾Ý±íÃû³Æ(×Ö¶ÎÃû³Æ1,×Ö¶ÎÃû³Æ2,...) values(×Ö¶ÎÖµ1,×Ö¶ÎÖµ2,...)
insert into user(username,password,age) values('ÀîÀÏËÄ','6666',45)
Update Êý¾Ý±íÃû³Æ Set ×Ö¶ÎÃû³Æ=×Ö¶ÎÖµ,×Ö¶ÎÃû³Æ=×Ö¶ÎÖµ,...[Where Ìõ¼þ]
Delete from Êý¾Ý±í
ÏÂÁвéѯ·µ»ØÔÚLONDON£¨Â×¶Ø£©»òSEATTLE£¨Î÷ÑÅͼ£©µÄËùÓйÍÔ±£º
S ......

Ó°ÏìSQL serverÐÔÄܵĹؼüÈý¸ö·½Ãæ

1 Âß¼­Êý¾Ý¿âºÍ±íµÄÉè¼Æ
Êý¾Ý¿âµÄÂß¼­Éè¼Æ¡¢°üÀ¨±íÓë±íÖ®¼äµÄ¹ØÏµÊÇÓÅ»¯¹ØÏµÐÍÊý¾Ý¿âÐÔÄܵĺËÐÄ¡£Ò»¸öºÃµÄÂß¼­Êý¾Ý¿âÉè¼Æ¿ÉÒÔΪ
ÓÅ»¯Êý¾Ý¿âºÍÓ¦ÓóÌÐò´òÏÂÁ¼ºÃµÄ»ù´¡¡£
±ê×¼»¯µÄÊý¾Ý¿âÂß¼­Éè¼Æ°üÀ¨ÓöàµÄ¡¢ÓÐÏ໥¹ØÏµµÄÕ­±íÀ´´úÌæºÜ¶àÁеij¤Êý¾Ý±í¡£ÏÂÃæÊÇһЩʹÓñê×¼»¯
±íµÄһЩºÃ´¦¡£
A:ÓÉÓÚ±íÕ­£¬Òò´Ë¿ÉÒÔʹŠ......

[SQL]ÈçºÎд³ö¸ßЧµÄSQL

±ÜÃâʹÓÃIN ²Ù×÷·û
   ÓÃINд³öÀ´µÄSQLµÄÓŵãÊDZȽÏÈÝÒ×д¼°ÇåÎúÒ×¶®£¬Õâ±È½ÏÊʺÏÏÖ´úÈí¼þ¿ª·¢µÄ·ç¸ñ¡£
µ«ÊÇÓÃINµÄSQLÐÔÄÜ×ÜÊDZȽϵ͵쬴ÓORACLEÖ´ÐеIJ½ÖèÀ´·ÖÎöÓÃINµÄSQLÓë²»ÓÃINµÄSQLÓÐÒÔÏÂÇø±ð£º
 ¡¡ORACLEÊÔͼ½«Æäת»»³É¶à¸ö±íµÄÁ¬½Ó£¬Èç¹ûת»»²»³É¹¦ÔòÏÈÖ´ÐÐINÀïÃæµÄ×Ó²éѯ£¬ÔÙ²éѯÍâ²ãµÄ±í¼Ç ......

SQLС¶Ì¾äÊÕ¼¯

Select TOP N * from TABLE Order By NewID() 
--Access£º
Select TOP N * from TABLE Order By Rnd(ID)  
Rnd(ID) ÆäÖеÄIDÊÇ×Ô¶¯±àºÅ×ֶΣ¬¿ÉÒÔÀûÓÃÆäËûÈκÎÊýÖµÀ´Íê³É£¬±ÈÈçÓÃÐÕÃû×Ö¶Î(UserName) 
Selec ......

[SQL]´¥·¢Æ÷µÄʹÓÃ

1. ´´½¨´¥·¢Æ÷, ÔÚmssqlϵĴ¥·¢Æ÷µÄʹÓÃ:Db->±í->Ñ¡Ôñ±íÃû->ËùÓÐÈÎÎñ(ÓÒ¼ü)->¹ÜÀí´¥·¢Æ÷
2. µ±±í±»¸üÐÂ\²åÈë\ɾ³ýºó,¶¼¿ÉÒÔͨ¹ý¶¨Òå´¥·¢Æ÷À´ÏìÓ¦¸Ãʼþ,´Ó¶ø½øÐÐÏàÓ¦µÄ´¦Àí! ÈçÒ»¸öѧÉúתϵÁË,ÆäѧºÅ±»¸ü»»ÁË,ËûËù½èµÄͼÊé¶ÔÓ¦µÄѧºÅÒ²ÏàÓ¦ÐèÒª¸Ä¶¯,Õâ¸öÎÒÃÇ¿ÉÒÔֻͨ¹ýupdateÆäѧºÅ,ºÍѧºÅÏà¹ØÁªµÄ±íÓÉ´¥·¢Æ÷ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ