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

¹ØÓÚʱ¼ä¶ÎµÄSQL£¨Orcale¡¢SQL Server£©²éѯ

Ò»¡¢Orcale ʱµÄ²éѯ
String hql = "from SmsTemplate t where 1=1 ";
 if (model != null && !"".equals(model.getEndTimes())&& null!=model.getEndTimes() ) {
   SimpleDateFormat dateFm = new SimpleDateFormat("yyyy-MM-dd"); //¸ñʽ»¯µ±Ç°ÏµÍ³ÈÕÆÚ
   Date endt = model.getEndTimes();
   String dateTime = dateFm.format(endt);
   
   hql += " and t.endTimes<= to_date('" + dateTime+"' ,'yyyy-mm-dd')"; //×¢Òâµ¥ÒýºÅ
   //hql += " and t.endTimes<= to_date('" + dateTime+"' ,'yyyy-mm-dd HH24:mi:ss')";//´øʱ¡¢·Ö¡¢Ãë ×¢Òâ mi
//×¢£ºendTimesÔÚÊý¾Ý¿âÖÐʱDATEÐ͵Ä
  }
¶þ¡¢ÆÕͨSQL Server ²éѯ
DECLARE @dt DATETIME
DECLARE @dt2 DATETIME
SET @dt = '2008-07-24'
SET @dt2 = DATEADD(day, 1, @dt)
select @dt as dt, @dt2 as dt2
select * from meet_now where meetdate between CONVERT(datetime , @dt, 111 ) and convert(datetime , @dt2, 111 ) order by id
select * from meet_now where DATEDIFF(day, meetdate, @dt) = 0 order by id


Ïà¹ØÎĵµ£º

SQL*Plus FAQ

 What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers ......

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 Ïàͬ¡£
΢ÈíµÄË ......

Îå²½¸ã¶¨sql server2005Êý¾Ý¿âÈÕÖ¾Çå³ý

1¡¢µÚÒ»²½£¬Ñ¡ÖÐÒªÇå³ýÈÕÖ¾µÄÊý¾Ý¿â——ÓÒ¼ü——ÊôÐÔ¡£
 
2¡¢µÚ¶þ²½£ºÔÚÑ¡ÏîҳѡÖГѡÏ¬»Ö¸´Ä£Ê½Ñ¡Ôñ“¼òµ¥”£¬µã»÷×îϱßÈ·¶¨°´Å¥¡£
 
3¡¢µÚÈý²½£¬ÔÙÑ¡ÖÐÊý¾Ý¿âÓÒ¼ü——ÈÎÎñ——ÊÕËõ——Êý¾Ý¿â¡£
 
4¡¢µÚËIJ½£¬µã»÷&ldq ......

SQLÖظ´¼Ç¼²éѯɾ³ý

1
¡¢²éÕÒ±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´ÅжÏ
select

*

from
people
where
peopleId
in
(
select
   peopleId  
from
   people  
group
  
by
   peopleId  
having
  
cou ......

Åú´¦ÀíbatÖ´ÐÐsql½Å±¾

set r=%time%
echo %r%¿ªÊ¼µ¼Èë >>e:\c#\test.txt
osql -S (local) -U sa -P -d colorring -i e:\c#\11.sql >>d:\c#\test.txt
echo %r%µ¼ÈëÍê³É >>e:\c#\test.txt
ÆäÖÐ11.sqlÖÐΪ
bulk insert  colorring..test from 'e:\c#\11.txt'
WITH (
FIELDTERMINATOR = ',',
ROWTERMINATOR ='\n' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ