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

SQLʱ¼äº¯Êý

 
SQLʱ¼äº¯Êý
--ÈÕÆÚת»»²ÎÊý,ÖµµÃÊÕ²Ø
select CONVERT(varchar, getdate(), 120 )2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')20040912110608
select CONVERT(varchar(12) , getdate(), 111 )2004/09/12
select CONVERT(varchar(12) , getdate(), 112 )20040912
select CONVERT(varchar(12) , getdate(), 102 )2004.09.12
ÆäËüÎÒ²»³£ÓõÄÈÕÆÚ¸ñʽת»»·½·¨:
select CONVERT(varchar(12) , getdate(), 101 )09/12/2004
select CONVERT(varchar(12) , getdate(), 103 )12/09/2004
select CONVERT(varchar(12) , getdate(), 104 )12.09.2004
select CONVERT(varchar(12) , getdate(), 105 )12-09-2004
select CONVERT(varchar(12) , getdate(), 106 )12 09 2004
select CONVERT(varchar(12) , getdate(), 107 )09 12, 2004
select CONVERT(varchar(12) , getdate(), 108 )11:06:08
select CONVERT(varchar(12) , getdate(), 109 )09 12 2004 1
select CONVERT(varchar(12) , getdate(), 110 )09-12-2004
select CONVERT(varchar(12) , getdate(), 113 )12 09 2004 1
select CONVERT(varchar(12) , getdate(), 114 )11:06:08.177
1. µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä
         select getdate()
2. dateadd ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ
ÀýÈ磺ÏòÈÕÆÚ¼ÓÉÏ2Ìì
select dateadd(day,2,'2004-10-15') --·µ»Ø£º2004-10-17 00:00:00.000
3. datediff ·µ»Ø¿çÁ½¸öÖ¸¶¨ÈÕÆÚµÄÈÕÆÚºÍʱ¼ä±ß½çÊý¡£
select datediff(day,'2004-09-01','2004-09-18') --·µ»Ø£º17
4. datepart ·µ»Ø´ú±íÖ¸¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄÕûÊý¡£
SELECT DATEPART(month, '2004-10-15') --·µ»Ø 10
5. datename ·µ»Ø´ú±íÖ¸¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄ×Ö·û´®
SELECT datename(weekday, '2004-10-15') --·µ»Ø£ºÐÇÆÚÎå
6. day(), month(),year() --¿ÉÒÔÓëdatepart¶ÔÕÕÒ»ÏÂ
select µ±Ç°ÈÕÆÚ=convert(varchar(10),getdate(),120)
,µ±Ç°Ê±¼ä=convert(varchar(8),getdate(),114)
select datename(dw,'2004-10-15')
select ±¾ÄêµÚ¶àÉÙÖÜ=datename(week,'2004-10-15')
,½ñÌìÊÇÖܼ¸=datename(weekday,'2004-10-15')
º¯Êý ²ÎÊý/¹¦ÄÜ
GetDate( ) ·µ»ØϵͳĿǰµÄÈÕÆÚÓëʱ¼ä
DateDiff (interval,date1,date2) ÒÔinterval Ö¸¶¨µÄ·½Ê½£¬·µ»Ødate


Ïà¹ØÎĵµ£º

SQL ServerÊý¾Ý¿â¿ª·¢µÄ¶þʮһÌõ¾ü¹æ(SQLÊÕ²Ø)

Èç¹ûÄãÕýÔÚ¸ºÔðÒ»¸ö»ùÓÚSQL ServerµÄÏîÄ¿£¬»òÕßÄã¸Õ¸Õ½Ó´¥SQL Server£¬Ä㶼ÓпÉÄÜÒªÃæÁÙһЩÊý¾Ý¿âÐÔÄܵÄÎÊÌ⣬ÕâƪÎÄÕ»áΪÄãÌṩһЩÓÐÓõÄÖ¸µ¼£¨ÆäÖдó¶àÊýÒ²¿ÉÒÔÓÃÓÚÆäËüµÄDBMS£©¡£
ÔÚÕâÀÎÒ²»´òËã½éÉÜʹÓÃSQL ServerµÄÇÏÃÅ£¬Ò²²»ÄÜÌṩһ¸ö°üÖΰٲ¡µÄ·½°¸£¬ÎÒËù×öµÄÊÇ×ܽáһЩ¾­Ñé----¹ØÓÚÈçºÎÐγÉÒ»¸öºÃµÄÉè¼Æ¡£Õ ......

QDM FOR SQL MODEL

 <?xml version="1.0" encoding="UTF-8"?>
<mdx>
    <sets>
        <set>
            <name>[promomonths] </name>
      &n ......

sql±¸Íü¼

SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--SQLÊý¾Ý¶¨Òå
CREATE TABLE --´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER TABLE --ÐÞ¸ÄÊý¾Ý¿â±í½á¹¹
CREATE VIEW --´´½¨Ò»¸öÊÓͼ
DROP VIEW --´ÓÊý¾Ý¿âÖÐɾ³ýÊ ......

Oracle SQL¾«ÃîSQLÓï¾ä½²½â


--ÐÐÁÐת»» ÐÐתÁÐ
DROP TABLE t_change_lc;
CREATE TABLE t_change_lc (card_code VARCHAR2(3), q NUMBER, bal NUMBER);
INSERT INTO t_change_lc
SELECT '001' card_code, ROWNUM q, trunc(dbms_random.VALUE * 100) bal from dual CONNECT BY ROWNUM <= 4
UNION
SELECT '002' card_code, ROWNUM q, trunc(d ......

SQL Server Indexing(½é紹SQL ServerË÷Òý)

 5.2 Clustered Indexes(¾Û¼¯Ë÷Òý) (page 122)
¾Û¼¯Ë÷Òý決¶¨ÁËÒ»個±í數據µÄÎïÀíÅÅÁÐ順Ðò£¬ËùÒÔ£¬Ò»個±í隻ÄÜÓÐÒ»個¾Û¼¯Ë÷Òý¡£圖5.1±íʾÁËÒ»個¾Û¼¯Ë÷ÒýµÄ結構¡£
Figure 5.1
The structure of a clustered index
Ò»個¾Û¼¯Ë÷ÒýµÄ×îµ×& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ