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

SQL SERVER¶àÁÐÈ¡×î´ó»òÕß×îСֵ

/*
lvl1  lvl2    lvl3    lvl4    lvl
4      3      4      1       
3      2      2      1   
2      2      3      4
4      4      3      4
3      1      2      2
Ôõôд´úÂë È¥±È½Ïlvl1¡¢lvl2¡¢lvl3¡¢lvl4 ¶ÔӦÿÐеÄÖµ£¬È¡ÆäÖÐ×îСµÄ£¬½«ÆäÖµÌí¼Óµ½lvlÁÐÀï
ÔËÐнá¹ûÓ¦¸ÃÊÇ
lvl
1
1
2
3
1
*/
--·½·¨(Ò») º¯數·¨
-->Title:Generating test data
-->Author:wufeng4552
-->Date :2009-10-16 09:58:16
if not object_id('Tempdb..#t') is null
    drop table #t
Go
Create table #t([lvl1] int,[lvl2] int,[lvl3] int,[lvl4] int,[lvl] int)
Insert #t
select 4,3,4,1,null union all
select 3,2,2,1,null union all
select 2,2,3,4,null union all
select 4,4,3,4,null union all
select 3,1,2,2,null
Go
if object_id('UF_minget')is not null drop function UF_minget
go
create function UF_minget
(@col1 int,@col2 int,@col3 int,@col4 int)
returns int
as
  begin
     declare @t table(col int)
     insert @t select @col1 union all
               select @col2 union all
               select @col3 union all
               select @col4
     return(select min(col)from @t)
  end
go
update t set [lvl]=dbo.UF_minget([lvl1],[lvl2],[lvl3],[lvl4])
from #t t
select * from #t
/*
lvl1   &


Ïà¹ØÎĵµ£º

JSPʵÀýÈý¡¢sql·ÖÒ³(1)

index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......

MySQL ×Ö·û¼¯µ¼ÖÂSQLÁ¬½ÓÖ®ºóÖÐÎÄÂÒÂëµÄÎÊÌ⣡

character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊ ......

AccessºÍSQL2000ÖÐÓï¾äµÄÇø±ð

1 £¬¶ÔÓÚÈÕÆÚ×Ö¶Î×Ö¶Î
access±íʾΪ£º#1981-28-12#
SQLSERVER2000±íʾΪ£º''1981-02-12''
2,SQLÓï¾äÇø±ð£¬select ,update ÔÚ¶Ôµ¥±í²Ù×÷ʱ¶¼²î²»¶à£¬
µ«¶à±í²Ù×÷ʱupdateÓï¾äµÄÇø±ðACCESSÓëSQLSERVERÖеÄUpdateÓï¾ä¶Ô±È:
SQLSERVERÖиüжà±íµÄUpdateÓï¾ä:
Update Tab1
SET a.Name = b.Name
from Tab1 a,Tab2 b
Whe ......

ÓÃOracleµÄtkprof·ÖÎöSQLÖ´ÐÐЧÂÊ

ÓÃOracleµÄtkprof·ÖÎöSQLÖ´ÐÐЧÂÊ
1¡¢´ò¿ª¸ú×Ù
SQL> alter session set sql_trace=true;
2¡¢Ö´ÐÐSQL
SQL> select count(*) from xxxx;
3¡¢¹Ø±Õ¸ú×Ù
SQL> alter session set sql_trace=false
4¡¢ÕÒµ½trcÎļþ
Ä¿±êÎļþĿ¼ÔÚ£º
SQL> select value from v$parameter where
name='user_dump_dest';
5¡¢± ......

SQL¼ò½é

 OracleϵÁУºSQL
Ò»£¬Ê²Ã´ÊÇSQL£¿
 1£¬SQLÈ«³ÆÊÇ“½á¹¹»¯²éѯÓïÑÔ(Structured Query Language)”£¬¹ØÏµÊý¾Ý¿â¹ÜÀíϵͳµÄÒ»ÖÖ²éѯÓïÑÔ¡£
 2£¬SQLÊǸ߼¶µÄ·Ç¹ý³Ì»¯±à³ÌÓïÑÔ£¬¾ßÓÐÍêÈ«²»Í¬µ×²ã½á¹¹µÄ²»Í¬Êý¾Ý¿âϵͳ¿ÉÒÔʹÓÃÏàͬµÄSQLÓïÑÔ×÷ΪÊý¾ÝÊäÈëÓë¹ÜÀíµÄ½Ó¿Ú¡£
 3£¬ÒԼǼ¼¯ºÏ×÷Ϊ²Ù× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ