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

SQLµÄ¼¸¸ö±àÂë¹æ·¶


1.±ÜÃâÔÚwhere×Ó¾äÖжÔ×Ö¶ÎÊ©¼Óº¯Êý£¬ÕâÑù½«µ¼ÖÂË÷ÒýʧЧ£¬±ÈÈ磺
select * from user where
to_char(create_time,'yyyymmdd')='20090101';
Ô­Òò£ºÔÚ½¨Á¢indexµÄʱºòÊǸù¾Ý×Ö¶ÎÀ´½¨Á¢µÄ£¬Ò²¾ÍÊÇ˵oracleÔÚinidexµÄʱºòÊÇË÷ÒýµÄ×ֶεÄÖµ£¬Èç¹ûÌṩ¸øoracleµÄÊÇÒ»¸öÐèÒª¾­¹ýº¯Êý´¦ÀíµÄ±È½Ï£¬oracle¾Íû°ì·¨Í¨¹ýË÷ÒýÖеÄË÷Òý¼üÖµÀ´½øÐÐÏàÓ¦µÄ±È½Ï£¬ËùÒԾͲ»»á×ßµ½Ë÷ÒýÉÏ
2.±ÜÃâÔÚSQLÖз¢ÉúÒþʽÀàÐÍת»»
È磺
select * from user where id='123';
--ÕâÀïIDÊÇNUMBERÐÍ,»áÔì³Éoracle½«idÏÈת»»³ÉvarcharÀàÐÍÔٱȽϣ¬Ôì³ÉË÷ÒýʧЧ
select * from user where
gmt_create =
to_char('2000-01-01','yyyy-mm-dd');
--ÕâÀïgmt_createÊÇdateÐÍ,»áÔì³Éoracle½«gmt_createÏÈת»»³ÉvarcharÀàÐÍÔٱȽϣ¬Ôì³ÉË÷ÒýʧЧ
3.È«Ä£ºý²éѯÎÞ·¨Ê¹ÓÃINDEX£¬Ó¦µ±¾¡¿ÉÄܱÜÃâ
select * from user where name like '%value%';
4.Èç¹ûʹÓÃOracleÊý¾Ý¿â£¬Ê¹ÓÃOracleµÄÍâÁ¬½Ó£¬¶ø²»ÊDZê×¼µÄÍâÁ¬½ÓÓï·¨
ÕýÈ·£ºselect * from user1 a,user2 b where a.id=b.id(+);
´íÎó£ºselect * from user1 a left join on user2 b a.id=b.id;
5.·ÖÒ³Óï¾ä±ØÐëʹÓÃÈý²ãǶÌ×µÄд·¨
select * from
(select rownum rn,a,* from
(select * from table where Ìõ¼þ
order by Ìõ¼þ) a
where rownum<=100) where rn>80;


Ïà¹ØÎĵµ£º

SQL ³£ÓÃÓï¾ä

1¡¢±í²Ù×÷¡£
1.1 ÏÖÓбíÔö¼Ó×Ö¶Î
alter table TableName add  
       columnName1  varchar(2) NULL,
       columnName2 varchar(2) NULL,
       columnName3 varchar(2) NULL
×¢Ò⣺²»ÓüÓColu ......

Åú´¦ÀíSQL Îļþ

@echo off
rem Input Parameters:
rem 1 -Server Name
rem 2 -Database Name
if "%1"=="" goto ERROR
if "%2"=="" goto ERROR
@rem Make variables local
@Setlocal
@rem set variables from input parameters
set Server=% 1
set DBName=% 2
@rem------------------------------------------------------------ ......

½ÌÄãÔÚSQL ServerÊý¾Ý¿âÖÐÉè¼Æ±íºÍ×Ö¶Î

ת×Ô£ºhttp://news.newhua.com/news1/program_database/2008/530/0853092638H5D5AAC4I06BI1G22DCAH8H8B7HIGB0G3F109J6E7F9K2_2.html?lt=common
1. ԭʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹Øϵ
¿ÉÒÔÊÇÒ»¶ÔÒ»¡¢Ò»¶Ô¶à¡¢¶à¶Ô¶àµÄ¹Øϵ¡£ÔÚÒ»°ãÇé¿öÏ£¬ËüÃÇÊÇÒ»¶ÔÒ»µÄ¹Øϵ£º¼´Ò»ÕÅԭʼµ¥¾Ý¶ÔÓ¦ÇÒÖ»¶ÔÓ¦Ò»¸öʵÌå¡£ÔÚÌØÊâÇé¿öÏ£¬ËüÃÇ¿ÉÄÜÊÇÒ»¶Ô¶ ......

SQL ServerÊÂÎñÈÕÖ¾ÒâÍâÔö´óµÄ´¦Àí·½·¨

ת×Ô£ºhttp://news.newhua.com/news1/program_database/2008/530/0853093226E2KJ93C02415FEB1CD9A5HCKA821556279EEKJ7728GI5.html
ÊÂÎñÈÕÖ¾ÎļþTransaction Log FileÊÇÓÃÀ´¼Ç¼Êý¾Ý¿â¸üÐÂÇé¿öµÄÎļþ£¬À©Õ¹ÃûΪldf¡£
ÔÚ SQL Server 7.0 ºÍ SQL Server 2000 ÖУ¬Èç¹ûÉèÖÃÁË×Ô¶¯Ôö³¤¹¦ÄÜ£¬ÊÂÎñÈÕÖ¾Îļþ½«»á×Ô¶¯À©Õ¹¡£
Ò»° ......

Oracle SQLÓëANSI SQLÇø±ð


Oracle SQLÓëANSI SQLÇø±ð
ÏàÐÅ´ó¼Ò¶¼Ê¹ÓùýSQL SERVER¡£½ñÌì¸ø´ó¼Ò¼òµ¥½éÉÜÒ»ÏÂOracle SQLÓëANSI SQLÇø±ð¡£Æäʵ£¬SQL SERVERÓëÓëANSI SQLÒ²ÓÐÇø±ð¡£
1¡¢Ê×ÏÈ´ó¼ÒÒªÃ÷°×ʲôÊÇANSI
ANSI£ºÃÀ¹ú¹ú¼Ò±ê׼ѧ»á£¨American National Standards Institute£©¡£µ±Ê±£¬ÃÀ¹úµÄÐí¶àÆóÒµºÍרҵ¼¼ÊõÍÅÌ壬ÒÑ¿ªÊ¼Á˱ê×¼»¯¹¤×÷£¬µ«Òò±Ë ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ