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

Çë½ÌSQLÓï¾ä²éѯÎÊÌ⣿ - MS-SQL Server / »ù´¡Àà

ÎÒÏë²éѯ³öÿÌìÊý¾ÝµÄ×î´óµÄÒ»¸öÖµ¡£±íµÄ¸ñʽÈçÏÂ
±íÃû: hisdata
×ֶΠ±àºÅ Öµ ״̬ ʱ¼ä  
  Id value state dattime  
  101 32.3 0 2010-4-7 12£º34£º56
  102 19.2 1 2010-4-7 12£º34£º46
  103 23.2 0 2010-4-7 14£º21£º02
  101 32.3 0 2010-4-7 15£º13£º31
  102 19.2 1 2010-4-7 15£º28£º24
  103 23.2 0 2010-4-7 15£º27£º46
  --- ---- -- ------
  --- ----- --- ------
  101 32.3 0 2010-4-10 7£º56£º24
  102 19.2 1 2010-4-10 7£º31£º32
  103 23.2 0 2010-4-10 8£º19£º15

  ±ÈÈçÒª²éѯ2009Äê4ÔÂ7ÈÕºÍ4ÔÂ10ÈÕÖ®¼ä ±àºÅΪ101µÄÿÌìÊý¾ÝµÄ×î´óÖµ£¬ÈçºÎд²éѯÓï¾ä лл




up.

SQL code:
select max(value) as maxValue,convert(varchar(10),[dattime],120) as [date]
from hisdata
where convert(varchar(10),[dattime],120) between '2009-04-07' and '2009-04-10'
and Id=101
group by convert(varchar(10),[dattime],120)


select top 1 datetime from testtable4 where Id='101' and convert(datetime,datetime1) between convert(datetime,'2010-04-07 12:00:00') and conve


Ïà¹ØÎÊ´ð£º

sqlÓï¾ä¶à±í¶à×ֶβéѯ - MS-SQL Server / »ù´¡Àà

ÎÒÓжà¸ö±íA B C ½á¹¹ÊÇÒ»ÑùµÄ£¬¶¼ÓÐ2¸ö×Ö¶ÎnameºÍcontent,ÎÒÒªËÑË÷ËùÒÔ±íËùÓÐ×Ö¶ÎÖаüº¬¡°Öйú¡±µÄÄÚÈÝ Õâ¸öSQLÓï¾äÔõôд 

ÈçºÎ½«¶à¸ö±íµÄ²éѯ½á¹ûÁ¬³ÉÒ»¸ö±í Õâ¸öSQLÓï¾äÔõôд ±íµÄ½á¹¹ÊÇÒ»ÑùµÄ
ÀýÈç£ ......

Ò»¸öpl/sqlÎÊÌâ - Oracle / ¿ª·¢

ÎÒÊÇÔÚtoadÖÐÊäÈë϶Îsql
  declare
  TYPE test_rec IS record(
  code varchar(10),
  name varchar(30)
  );
  v_book test_rec;
    ......

Á½¾äSQL²¢Ò»¾ä,ÓÐÎÊÌâ. - MS-SQL Server / »ù´¡Àà

µÚÒ»¾ä:
select ht.gfdm,gfdm.gfmc,gfdm.lb ,sum(jh.htdj*jh.htsl)as je
from ht left join gfdm on ht.gfdm=gfdm.gfdm 
 join jh on ht.htbh=jh.hth 
and ht.htbh not like'del%' and ht. ......

ÇóÒ»SQLд·¨ - MS-SQL Server / »ù´¡Àà

id                           url                   rank     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ