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

¹ØÓÚsqlµÄÁ´½Ó²éѯ


Ê×Ïȸø³öÁ½ÕŲâÊÔ±í
a(aid int, adata varchar(20))            b(bid int, bdata varchar(20))
1.join Óë inner join
Ö´ÐÐÈçÏÂÓï¾ä£º
select * from a join b on a.aid = b.bid;
ÎÒÃÇ»áµÃµ½ÈçϵĽá¹û£º
       AID ADATA                                           BID BDATA
---------- ---------------------------------------- ---------- ----------------------------------------
         1   a1                                                       1        b1
         2   a2                                                       2        b2
ÎÒÃÇÔÚÖ´ÐУºselect * from a inner join b on a.aid = b.bid;
Õâʱ»á·¢ÏÖÖ´ÐеĽá¹ûºÍÉÏÃæÒ»Ñù£¬ÓÚÊÇÎÒÔÚÕâÀïÈÏΪ£¬µ¥Ð´Ò»¸öjoinµÄÓï¾ä£¬Ä¬ÈÏʹÓÃinnerÐÎʽÁ¬½Ó²éѯ¡£ÕâʱÎÒÒ²»áÏëµ½Óñê×¼µÄ¶à±í²éѯȥʵÏÖ£¬È磺select * from a, b where a.aid = b.bid¡£
ÉÏÃæÕâЩ¶¼ÊÇÔÚoracleºÍmysqlÖвâÊÔ¹ýµÄ£¬µ±È»ÏÂÃæËùÌáµ½µÄÒ²»á×öͬÑùµÄ²âÊÔ¡£
2.left join Óë left outer join
Ö´ÐÐÈçÏÂÓï¾ä£º
select * from a left join b on a.aid = b.bid;
µÃµ½µÄ½á¹ûÈçÏ£º
       AID ADATA&


Ïà¹ØÎĵµ£º

PL/SQL developerÔ¶³Ì·ÃÎÊÊý¾Ý¿âÅäÖ÷½·¨

ʹÓÃPL/SQL developerÔ¶³Ì·ÃÎÊoracleÊý¾Ý¿âʱ£¬Ê×ÏÈҪȷ¶¨±¾»úÖÐ×°ÓÐoracle¿Í»§¶Ë¡£Ä¿Ç°»¹²»ÖªµÀÄÄÀïµ¥¶ÀµÄoracle¿Í»§¶Ë°²×°°ü¡££¨ÒòΪÎÒÓõÄÊÇoracle10g£¬oracle10g°²×°µÄ¹ý³ÌÖÐûÓÐÌض¨µÄ¿Í»§¶ËÑ¡ÏËùÒÔÎÒÒ»°ã¶¼ÊÇÔÚ±¾»úÓð²×°oracleËùÓй¦ÄÜ£©
ÔÚ±¾»ú°²×°ºÃoracle¿Í»§¶Ëºó£¬ÎÒÃÇÔÚ±¾»ú(¼´¿Í»§¶Ë)µÄoracleµÄ°²×°Ä¿Â¼Ï ......

½â¾ö°²×°SQL Server2000 Îļþ¹ÒÆð

      1.²»ÓÃÍ˳öSQL2000°²×°³ÌÐò,Ö±½ÓÇл»µ½×ÀÃæ.
¡¡¡¡2.´ò¿ª×¢²á±í±à¼­Æ÷£¨ÔÚ“ÔËÐДÖÐÇÃÈë“regedit”Ö®ºó»Ø³µ¼´¿É£©£¬¶¨Î»µ½×¢²á±íµÄHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager½Úµã.
¡¡¡¡3.µ¥»÷“Session Manager”Õâ¸ö½Úµã£¬ ......

SQL ServerÖлã×ܹ¦ÄܵÄʹÓÃGROUPING,ROLLUPºÍCUBE

1.Óà CUBE »ã×ÜÊý¾Ý
 CUBE ÔËËã·ûÉú³ÉµÄ½á¹û¼¯ÊǶàάÊý¾Ý¼¯¡£¶àάÊý¾Ý¼¯ÊÇÊÂʵÊý¾ÝµÄÀ©Õ¹£¬ÊÂʵÊý¾Ý¼´¼Ç¼¸ö±ðʼþµÄÊý¾Ý¡£À©Õ¹½¨Á¢ÔÚÓû§´òËã·ÖÎöµÄÁÐÉÏ¡£ÕâЩÁб»³ÆΪά¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸ö½á¹û¼¯£¬ÆäÖаüº¬Á˸÷ά¶ÈµÄËùÓпÉÄÜ×éºÏµÄ½»²æ±í¸ñ¡£ CUBE ÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ ......

sql´æ´¢¹ý³ÌÓï·¨

 
Ò».×¢ÊÍ
  -- µ¥ÐÐ×¢ÊÍ£¬´ÓÕâµ½±¾ÐнáÊøΪעÊÍsql Óï·¨£¬ÀàËÆC++£¬c#ÖÐ//
  /* ¡­ */ ¶àÐÐ×¢ÊÍ£¬ÀàËÆC++£¬C#ÖÐ/* ¡­ */

¶þ.±äÁ¿£¨int£¬ smallint£¬ tinyint£¬ decimal£¬float£¬real£¬ money £¬smallmoneysql Óï·¨£¬ text £¬image£¬ char£¬ varchar¡£¡£¡£¡£¡£¡££©
Óï·¨£º
DECLARE
&nb ......

SQLÌæ»»Ö¸¶¨ÁÐ×Ö·û´®

 -- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comm ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ