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

SQL Server ÈÕÆÚ²Ù×÷È«½Ó´¥

DECLARE @dt datetime
SET @dt=GETDATE()
DECLARE @number int
SET @number=3
--1£®Ö¸¶¨ÈÕÆÚ¸ÃÄêµÄµÚÒ»Ìì»ò×îºóÒ»Ìì
--A. ÄêµÄµÚÒ»Ìì
SELECT CONVERT(char(5),@dt,120)+'1-1'
--B. ÄêµÄ×îºóÒ»Ìì
SELECT CONVERT(char(5),@dt,120)+'12-31'
--2£®Ö¸¶¨ÈÕÆÚËùÔÚ¼¾¶ÈµÄµÚÒ»Ìì»ò×îºóÒ»Ìì
--A. ¼¾¶ÈµÄµÚÒ»Ìì
SELECT CONVERT(datetime,
    CONVERT(char(8),
        DATEADD(Month,
            DATEPART(Quarter,@dt)*3-Month(@dt)-2,
            @dt),
        120)+'1')
--B. ¼¾¶ÈµÄ×îºóÒ»Ì죨CASEÅжϷ¨£©
SELECT CONVERT(datetime,
    CONVERT(char(8),
        DATEADD(Month,
            DATEPART(Quarter,@dt)*3-Month(@dt),
            @dt),
        120)
    +CASE WHEN DATEPART(Quarter,@dt) in(1,4)
        THEN '31'ELSE '30' END)
--C. ¼¾¶ÈµÄ×îºóÒ»Ì죨ֱ½ÓÍÆËã·¨£©
SELECT DATEADD(Day,-1,
    CONVERT(char(8),
        DATEADD(Month,
            1+DATEPART(Quarter,@dt)*3-Month(@dt),
            @dt),
        120)+'1')
--3£®Ö¸¶¨ÈÕÆÚËùÔÚÔ·ݵĵÚÒ»Ìì»ò×îºóÒ»Ìì
--A. ÔµĵÚÒ»Ìì
SELECT CONVERT(datetime,CONVERT(char(8),@dt,120)+'1')
--B. ÔµÄ×îºóÒ»Ìì
SELECT DATEADD(Day,-1,CONVERT(char(8),DATEADD(Month,1,@dt),120)+'1')
--C. ÔµÄ×îºóÒ»Ì죨ÈÝÒ×ʹÓõĴíÎó·½·¨£©
SELECT DATEADD(Month,1,DATEADD(Day,-DAY(@dt),@dt))
--4£®Ö¸¶¨ÈÕÆÚËùÔÚÖܵÄÈÎÒâÒ»Ìì
SELECT DATEADD(Day,@number-DATEPART(Weekday,@dt),@dt)
--5£®Ö¸¶¨ÈÕÆÚËùÔÚÖܵÄÈÎÒâÐÇÆÚ¼¸
--A.  ÐÇÆÚÌì×öΪһÖܵĵÚ1Ìì
SELE


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

sql 2000MMC ²»ÄÜ´ò¿ªÎļþ

 MMC ²»ÄÜ´ò¿ªÎļþ C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC¡£¿ÉÒÔÔ­ÒòÊÇÎļþ²»´æÔÚ£¬²»ÊÇÒ»¸öMMC¿ØÖÆ̨£¬»òÕßÓúóÀ´MMC°æ±¾´´½¨£¬Ò²ÐíҲûÓзÃÎÊ´ËÎļþµÄ×㹻ȨÏÞ¡£
½â¾ö·½·¨£º
ÖØд´½¨´ËÎļþ£¬ÔËÐжԻ°¿òÖÐÊäÈë:mmc
1) ¿ØÖÆ̨-->Ìí¼Ó/ɾ³ý¹ÜÀíµ¥Ôª-->Ìí¼ ......

ÈçºÎ´Ó PL/SQL ´æ´¢º¯Êý·µ»ØÊý×é

ÈÕÆÚ£º2003 Äê 2 Ô 19 ÈÕ
Íê³É´Ë·½·¨Ö¸ÄϺó£¬ÄúÓ¦¸ÃÄܹ»£º
ÔÚ Oracle Êý¾Ý¿âÖд´½¨ VARRAY
ʹÓà oracle.sql.ARRAY Àà
´Ó Java ·ÃÎÊ VARRAY
¼ò½é
±¾ÎĵµÑÝʾÈçºÎ´Ó PL/SQL º¯Êý·µ»ØÊý×é²¢´Ó java Ó¦ÓóÌÐò·ÃÎÊËü¡£Êý×éÊÇÒ»×éÓÐÐòµÄÊý¾ÝÔªËØ¡£ VARRAY ÊÇ´óС¿É±äµÄÊý×é¡£Ëü¾ßÓÐÊý¾ÝÔªËصÄÅÅÁм¯£¬²¢ÇÒËùÓÐÔªËØÊôÓÚ ......

¶¯Ì¬sqlÓï¾ä»ù±¾Óï·¨

1 :ÆÕͨSQLÓï¾ä¿ÉÒÔÓÃExecÖ´ÐÐ
      Àý:      Select * from tableName
                Exec('select * from tableName')
        & ......

ÈçºÎÈÃÄãµÄSQLÔËÐеøü¿ì

 
 
ÈçºÎÈÃÄãµÄSQLÔËÐеøü¿ì
 
----   ÈËÃÇÔÚʹÓÃSQLʱÍùÍù»áÏÝÈëÒ»¸öÎóÇø£¬¼´Ì«¹Ø×¢ÓÚËùµÃµÄ½á¹ûÊÇ·ñÕýÈ·£¬¶øºöÂÔ   
  Á˲»Í¬µÄʵÏÖ·½·¨Ö®¼ä¿ÉÄÜ´æÔÚµÄÐÔÄܲîÒ죬ÕâÖÖÐÔÄܲîÒìÔÚ´óÐ͵ĻòÊǸ´ÔÓµÄÊý¾Ý¿â   
  »·¾³ÖУ¨ÈçÁª»úÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ