sql 2005
“¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷”¡£ÐÅÏ¢¼¼ÊõÔÚÉÌÒµÁìÓòÓ¦ÓõÄ׿Խ³ÉЧÔÚ¾¹ý½ü20ÄêµÄÐÅÏ¢»¯½¨ÉèÒѾ³õ²½ÏÔÏÖ¡£Æóҵͨ¹ýMIS£¨¹ÜÀíÐÅϢϵͳ£©¿ìËÙÊÕ¼¯ºÍ´¦ÀíÉÌÒµÐÅÏ¢£¬Í¨¹ýERP£¨ÆóÒµ×ÊÔ´¼Æ»®ÏµÍ³£©×¼È·¼à¿ØÐÅÏ¢Á÷£¬´Ó¶ø¶ÔÆóÒµ¾ÓªµÄ¸÷¸ö·½Ãæ½øÐйÜÀí¡£ÕâЩϵͳ³ýÁ˱¾ÉíµÄÓ¦ÓÃÍ⣬»¹»ýÀÛÁË´óÁ¿µÄÊý¾Ý£¬ÈçÀ´×ÔÒµÎñϵͳµÄ¶©µ¥¡¢¿â´æ¡¢½»Ò×ÕËÄ¿¡¢¿Í»§ºÍ¹©Ó¦ÉÌ×ÊÁÏ£¬À´×ÔÆóÒµËù´¦ÐÐÒµºÍ¾ºÕù¶ÔÊÖµÄÊý¾Ý£¬ÒÔ¼°À´×ÔÆóÒµËù´¦µÄÆäËûÍⲿ»·¾³Öеĸ÷ÖÖÊý¾Ý£¬ÕâÊÇÒ»±Ê±¦¹óµÄ²Æ¸»¡£ÐÅϢϵͳӦ¸Ã¾ß±¸°ÑÕâЩÅÓ´óµÄÊý¾Ýת»¯ÎªÖªÊ¶£¬½ø¶ø¸¨ÖúÆóÒµ¾Óª¾ö²ß£¬ÉõÖÁ×Ô¶¯Éú³ÉÉÌÒµ¾ö²ßµÄÄÜÁ¦£¬Õâ¾ÍÊÇÉÌÒµÖÇÄÜ¡£ÐÅϢϵͳÕýÔÚ¾Àú×Å“MIS→ERP→BI”µÄÑݱä¹ý³Ì¡£±¾Õ½«¶ÔÓÚÉÌÒµÖÇÄÜÉæ¼°µ½µÄÏà¹Ø¼¼Êõ£¬ÈçÊý¾Ý²Ö¿â£¨DW£©¡¢Êý¾ÝÍÚ¾ò£¨DM£©µÈ½øÐиÅÒªµØ·ÖÎö£¬Í¬Ê±´ÓÀíÂÛÉÏÃ÷È·ÉÌÒµÖÇÄÜÔÚÆóÒµ¾Óª¾ö²ß¹ý³ÌÖеļÛÖµ·¢»ÓÔÀí¡£
±¾ÕÂÏȼòµ¥µØ˵Ã÷ÆóÒµ¾Óª¹ÜÀí»î¶¯¶ÔÉÌÒµÖÇÄܵÄÐèÇ󣬴ӶøÃ÷ȷʵʩBIµÄÔÒò£¬½â¾öWhyµÄÎÊÌ⣻ÔÙ²ûÊöÉÌÒµÖÇÄܵļ¼Êõ¹¹³É£¬´ó¸ÅÁ˽âÈçºÎʵÏÖÉÌÒµÖÇÄÜ£¬½â¾öWhatºÍHowµÄÎÊÌ⣻×îºóÁоÙһЩʵ¼Ê²¿ÊðµÄ²¿ÊðÉÌÒµÖÇÄÜÏîÄ¿½á¹û£¬½â¾öWhat EffectµÄÎÊÌâ¡£
1.1 ÆóÒµ¾Óª¹ÜÀí»î¶¯¶ÔÉÌÒµÖÇÄܵÄÐèÇó
ÐÅϢϵͳÔÚÆóÒµ¹ÜÀíÖеÄÓ¦Óò»½öËæ׏ÜÀíÀíÄîµÄ¸üжø·¢Õ¹£¬»¹Ôںܴó³Ì¶ÈÉÏÒÀÀµÓÚÆóÒµÉÌÒµÐÅÏ¢µÄ´æ´¢Á¿¡£Ëæ×ÅÉç»á½Ú×àµÄ¼Ó¿ì£¬ÆóÒµÐÅÏ¢»ýÀÛÔ½À´Ô½¶à£¬¶øÉÌҵ֪ʶµÄÐèÇóÈ´µÃ²»µ½Âú×㣬ÓÚÊǾÍÌá³öÁËÉÌÒµÖÇÄܵĸÅÄî¡£ÕâÒ»½Ú½«¶ÔÉÌÒµÖÇÄÜϵͳӦÓõÄÉî²ãÔÒò½øÐÐ̽ÌÖ¡£
1.1.1 ÆóÒµ¾Óª»î¶¯ÃæÁÙµÄÌôÕ½
ÆóÒµ¾Óª»î¶¯°üÀ¨²É¹º¡¢Éú²ú¡¢ÏúÊÛ¡¢ÉÌó´èÉÌ¡¢¼Û¸ñ±È½Ï¡¢¾Óª¾ö²ß¡¢ÓªÏú²ßÂÔ¡¢ÍÆÏú´ÙÏú¡¢¹«¹ØÐû´«¡¢ÊÛÇ°/ÊÛºó·þÎñ¡¢¿Í»§¹ØϵºÍ×Éѯ·þÎñµÈ¡£ÕâЩ»î¶¯µÄ±³ºóʵ¼ÊÉÏÓÐ3ÖÖ“Á÷”ÔÚÖ§³Ö×ÅÕû¸öÆóÒµµÄÔËת£ºÎïÁ÷¡¢×ʽðÁ÷ºÍÐÅÏ¢Á÷¡£
“ÎïÁ÷”ÊÇ´ÓÔ²ÄÁϺÍÁãÅä¼þµ½³ÉÆ·Õû¸öÎï×ÊÁ÷ͨµÄ¹ý³Ì¡£Ëü½«ÔËÊä¡¢²Ö´¢¡¢¼Ó¹¤¡¢ÕûÀíºÍÅäË͵ÈÕû¸öÎï×ÊÁ÷ͨ¹ý³Ìͨ¹ýÐÅÏ¢Óлú½áºÏ£¬ÐγÉÍêÕûµÄ¹©Ó¦ºÍÐèÇóÁ´¡£
“×ʽðÁ÷”ÊÇ×ʽðÔÚÆóÒµÄÚ²¿ºÍÆóÒµÖ®¼äµÄÁ÷¶¯¹ý³Ì¡£Ëü°üÀ¨ÈÚ×Ê¡¢Ó¦ÊÕÕË¿îºÍÓ¦¸¶ÕË¿îµÄ¹ÜÀíµÈ£¬Éæ¼°²ÆÎñµÄ¸÷¸ö·½Ãæ¡£
“ÐÅÏ¢Á÷”ÊÇÆóÒµ¹ÜÀíµÄ¸÷¸ö»·½Ú²úÉúµÄÐÅÏ¢µÄ¹æÂÉÐÔÁ÷¶¯¡£ÈçÒµÎñÔË×÷¹ý³Ì²úÉúµÄµ¥¾Ý¼°Æä´¦Àí¹ý³Ì£»¾Óª¹ÜÀí¹ý³ÌÖеijɱ¾¡¢ÊÕÈë¡¢ÀûÈó±¨±í¼°ÆäÏ໥¹ØÁª£»Õ½ÂÔ¾ö²ß¹æ»®¹ý³ÌÖеIJúÆ·½á¹¹¼°Êг¡¶¨Î»Ð
Ïà¹ØÎĵµ£º
SQL SERVER ºÍEXCELµÄÊý¾Ýµ¼Èëµ¼³ö
1¡¢ÔÚSQL SERVERÀï²éѯExcelÊý¾Ý:
-- ======================================================
SELECT *
from OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
ÏÂÃæÊǸö²éÑ ......
µÚÒ»²¿·Ö
µ¥±í²éѯ
ÀýÒ»£º²éѯȫÌåѧÉúµÄѧºÅÓëÐÕÃû
SELECT Sno,Sname
from Student;
Àý¶þ£º²éѯȫÌåѧÉúµÄÐÕÃû¡¢Ñ§ºÅ¡¢ËùÔÚϵ
SELECT Sname,Sno,Sdept
from Student;
ÀýÈý£º²éѯȫÌåѧÉúµÄÏêϸ¼Ç¼
SELECT *
from Student;
µÈ¼ÛÓÚ£º
SELECT *
from Student;
ÀýËÄ£º²éѯȫÌåѧÉúµÄÐÕÃû¼°Æä³öÉúÄê·Ý
......
OracleµÄsql*plusÊÇÓëoracle½øÐн»»¥µÄ¿Í»§¶Ë¹¤¾ß¡£ÔÚsql*plusÖУ¬¿ÉÒÔÔËÐÐsql*plusÃüÁîÓësql*plusÓï¾ä¡£
¡¡¡¡
¡¡¡¡ÎÒÃÇͨ³£Ëù˵µÄDML¡¢DDL¡¢DCLÓï¾ä¶¼ÊÇsql*plusÓï¾ä£¬ËüÃÇÖ´ÐÐÍêºó£¬¶¼¿ÉÒÔ±£´æÔÚÒ»¸ö±»³ÆΪsql bufferµÄÄÚ´æÇøÓòÖУ¬²¢ÇÒÖ»Äܱ£´æÒ»Ìõ×î½üÖ´ÐеÄsqlÓï¾ä£¬ÎÒÃÇ¿ÉÒÔ¶Ô±£´æÔÚsql bufferÖеÄsql Óï¾ä½ø ......
select datediff(month,'2009-11-02','2009-12-01')
²»ÖªµÀÄãÒªÔõô¸öÔ²îÒì
ÉÏÃæµÄÃüÁî½á¹ûÒ²ÊÇ1
µ«ÊÇÆäʵ°´ÕÕ³£Ê¶²îÒì²»ÊÇÒ»¸öÔ£¬ÊDzîÒ»ÌìÒ»¸öÔÂ
ÕâÓжÎÏֳɵĴúÂë¿ÉÒÔ°ïÖúÄãËã³ö³£Ê¶ÉϵIJîÒì
SQL code
declare @t table(a datetime,b datetime);
insert @t
select '2009-11-02','2009-12-01' UNION ......
ÊÀʶ´Ã÷½ÔѧÎÊ£¬ÈËÇéÁ·´ï¼´ÎÄÕ¡£×öASPʱ£¬×î³£ÓõÄÊý¾Ý¿â¼´SqlserverÓëAccessÊý¾Ý¿âĪÊôÁË£¡
µ«Ê¹Óûᾳ£·¢ÏֺܶàSQLÖ´ÐеÄÎÊÌâ¡£ÕâÀïÕûÀí³öÖ®¼äµÄ²îÒ죬×ö¸öÊ®´ó²îÒìµÄ×ܽᡣ
ACCESS½á¹¹¼òµ¥ÈÝÒ×´¦Àí£¬¶øÇÒÒ²ÄÜÂú×ã¶àÊýµÄÍøÕ¾³ÌÐòÒªÇó£¬Ò²ÊdzõѧÕßµÄÊÔÅ£µ¶¡£
ACCESSÊÇСÐÍÊý¾Ý¿â£¬¼ÈÈ»ÊÇСÐ;ÍÓÐËû¸ù±¾µÄ¾ÖÏÞÐÔ£º
......