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

sql ²éѯÌõ¼þ×Ö¶ÎΪtext»òntext µÄ½â¾ö·½°¸

sql ²éѯÌõ¼þ×Ö¶ÎΪtext»òntextµÃ½â¾ö·½°¸ÒÔ¼°varchar(max)¡¢nvarchar(max)
1¡¢ÔÚMS SQL2005¼°ÒÔÉϵİ汾ÖУ¬¼ÓÈë´óÖµÊý¾ÝÀàÐÍ£¨varchar(max)¡¢nvarchar(max)¡¢varbinary(max) £©¡£´óÖµÊý¾ÝÀàÐÍ×î¶à¿ÉÒÔ´æ´¢2^30-1¸ö×Ö½ÚµÄÊý¾Ý¡£
Õ⼸¸öÊý¾ÝÀàÐÍÔÚÐÐΪÉϺͽÏСµÄÊý¾ÝÀàÐÍ varchar¡¢nvarchar ºÍ varbinary Ïàͬ¡£
΢ÈíµÄ˵·¨ÊÇÓÃÕâ¸öÊý¾ÝÀàÐÍÀ´´úÌæÖ®Ç°µÄtext¡¢ntext ºÍ image Êý¾ÝÀàÐÍ£¬ËüÃÇÖ®¼äµÄ¶ÔÓ¦¹ØÏµÎª£º
varchar(max)-------text;
nvarchar(max)-----ntext;
varbinary(max)----image.
ÓÐÁË´óÖµÊý¾ÝÀàÐÍÖ®ºó£¬ÔÚ¶Ô´óÖµÊý¾Ý²Ù×÷µÄʱºòÒª±ÈÒÔǰÁé»îµÄ¶àÁË¡£±ÈÈ磺֮ǰtextÊDz»ÄÜÓÑlike’µÄ£¬ÓÐÁËvarchar(max)Ö®ºó¾ÍûÓÐÕâЩÎÊÌâÁË£¬ÒòΪvarchar(max)ÔÚÐÐΪÉϺÍvarchar(n)ÉÏÏàͬ£¬ËùÒÔ£¬¿ÉÒÔÓÃÔÚvarcahrµÄ¶¼¿ÉÒÔÓÃÔÚvarchar(max)ÉÏ¡£
 ËùÒÔÇëʹÓà varchar(max)¡¢nvarchar(max) ºÍ varbinary(max) Êý¾ÝÀàÐÍ£¬¶ø²»ÒªÊ¹Óà text¡¢ntext ºÍ image Êý¾ÝÀàÐÍ¡£
2¡¢Èç¹ûÐèÒª´¦ÀíÒѾ­´æÔÚµÄtextÀàÐÍ µÄ²éѯ ÔòÐèÒª½øÐÐ×Ö¶Îת»»Ï where cast(text as varchar)
3¡¢ÊµÀýÈçÏ£¬ÆäÖÐi_itemΪntext
select * from IP_Investigate
where I_InvestigateID in (select IS_ID from IP_InvestigateStatus
where IS_Name like 'tomcat%') and cast(i_item as varchar)='1'
update IP_Investigate
set i_order=5
where I_InvestigateID in (select IS_ID from IP_InvestigateStatus
where IS_Name like 'tomcat%') and cast(i_item as varchar)='5'


Ïà¹ØÎĵµ£º

sqlÈÕÆÚÄ£ºý²éѯ SQLʱ¼äת»»¸ñʽ

Select * from t_user_profile where convert ( varchar ( 21 ),regDate, 120 ) like ' 2008-05-07% ' ±íÃû³Æ£ºt_user_profile ÈÕÆÚ×Ö¶ÎÃû³Æ£ºregDate
Select   *   from t_user_profile  where  convert(varchar(21),regDate,120) like '2008-05-07%'< ......

sqlº¯Êý¡¡

1¡¢ISNULL ( check_expression , replacement_value )
²ÎÊý
check_expression
½«±»¼ì²éÊÇ·ñΪ NULLµÄ±í´ïʽ¡£check_expression ¿ÉÒÔÊÇÈκÎÀàÐ͵ġ£
replacement_valueÔÚ check_expressionΪNULLʱ½«·µ»ØµÄ±í´ïʽ¡£replacement_value ±ØÐëÓë check_expresssion ¾ßÓÐÏàͬµÄÀàÐÍ¡£
·µ»ØÀàÐÍ
·µ»ØÓë check_expression Ï ......

¾­µäSQLÓï¾ä´óÈ«

ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
......

PL/SQLѧϰ±Ê¼Ç¶þ


1.³£Á¿
¶¨ÒåÓï·¨¸ñʽ£º
³£Á¿Ãû constant ÀàÐͱêʶ·û [not null]:=Öµ;
È磺PI constant number(9):=3.1415;
2.»ù±¾Êý¾ÝÀàÐͱäÁ¿
»ù±¾Êý¾ÝÀàÐÍ
number  Êý×ÖÐÍ
int ÕûÊýÐÍ
pls_integer ÕûÊýÐÍ£¬²úÉúÒç³öʱ³öÏÖ´íÎó
binary_integer ÕûÊýÐÍ£¬±íʾ´ø·ûºÅµÄÕûÊý
char ¶¨³¤×Ö·ûÐÍ£¬×î´ó255¸ö×Ö·û
varchar2 ±ä³¤× ......

PL/SQLѧϰ±Ê¼ÇÆß


Oracle9iÒì³£´¦Àí·ÖΪϵͳԤ¶¨ÒåÒì³£´¦ÀíºÍ×Ô¶¨ÒåÒì³£´¦ÀíÁ½²¿·Ö¡£
×Ô¶¨ÒåÒì³£´¦Àí
1.¶¨ÒåÒì³£´¦Àí
declare Òì³£Ãû exception;
2.´¥·¢Òì³£´¦Àí
raise Òì³£Ãû
3.´¦ÀíÒì³£
exception
when Òì³£Ãû1 then
    Òì³£´¦ÀíÓï¾ä¶Î1;
when Òì³£Ãû2 then
    Òì³£´¦ÀíÓï¾ä¶Î2;
ʾÀý£º
se ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ